Unnamed repository; edit this file 'description' to name the repository.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
package main

import (
	"fmt"
	"strings"
)

type Point struct {
	X int
	Y int
}

func compute(a int, b int) int {
	values := []int{
		1,
		2,
		3,
	}
	lookup := map[string]int{
		"a": 1,
		"b": 2,
	}
	for i, v := range values {
		if v > a {
			fmt.Println(i, v)
		} else {
			fmt.Println(lookup["a"])
		}
	}
	switch a {
	case 1:
		return b
	case 2:
		return a
	default:
		return 0
	}
}

func pipe(ch chan int) {
	select {
	case msg := <-ch:
		fmt.Println(msg)
	default:
		fmt.Println(strings.TrimSpace("none"))
	}
Loop:
	for {
		break Loop
	}
}

type Shape interface {
	Area() float64
	Perimeter() float64
}

type Circle struct {
	Radius float64
}

func (c Circle) Area() float64 {
	return 3.14 * c.Radius * c.Radius
}

const (
	StatusOK    = 200
	StatusError = 500
)

var (
	count   int
	enabled bool
)

func process(items []int) (int, error) {
	defer func() {
		recover()
	}()

	sum := 0
	for _, v := range items {
		switch x := any(v).(type) {
		case int:
			sum += x
		default:
			continue
		}
	}

	go func() {
		fmt.Println(sum)
	}()

	point := struct {
		X, Y int
	}{
		X: 1,
		Y: 2,
	}

	return point.X, nil
}

func rawString() string {
	query := `
first
	indented in raw
last`
	return query
}