feat: initial Go project with test

This commit is contained in:
ilia 2026-04-16 01:45:49 +00:00
parent 3592b907b2
commit ecb9f584d8
3 changed files with 23 additions and 0 deletions

3
go.mod Normal file
View file

@ -0,0 +1,3 @@
module test-go-project
go 1.22

11
main.go Normal file
View file

@ -0,0 +1,11 @@
package main
import "fmt"
func main() {
fmt.Println("Hello from Forgejo!")
}
func Add(a, b int) int {
return a + b
}

9
main_test.go Normal file
View file

@ -0,0 +1,9 @@
package main
import "testing"
func TestAdd(t *testing.T) {
if got := Add(2, 3); got != 5 {
t.Errorf("Add(2, 3) = %d, want 5", got)
}
}