1package main
2
3import "fmt"
4
5// Simple function
6func Hello() {
7 fmt.Println("Hello")
8}
9
10// Function with parameters
11func Add(a int, b int) int {
12 return a + b
13}
14
15// Struct type
16type Point struct {
17 X int
18 Y int
19}
20
21// Interface type
22type Describer interface {
23 Describe() string
24}
25
26// Method declaration
27func (p Point) Describe() string {
28 return fmt.Sprintf("Point(%d, %d)", p.X, p.Y)
29}
30
31// Constant declaration
32const MaxValue = 100