summaryrefslogtreecommitdiff
path: root/tests/test.go
blob: 9df6eb0f4b09d16d1584305f03aeb24b4a091362 (plain)
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
package main

import "fmt"

// Simple function
func Hello() {
	fmt.Println("Hello")
}

// Function with parameters
func Add(a int, b int) int {
	return a + b
}

// Struct type
type Point struct {
	X int
	Y int
}

// Interface type
type Describer interface {
	Describe() string
}

// Method declaration
func (p Point) Describe() string {
	return fmt.Sprintf("Point(%d, %d)", p.X, p.Y)
}

// Constant declaration
const MaxValue = 100