Answer by Julisch for How to use self defined package
Golang uses the source files of your imported packages. So when you wanna use the package go-package/math inside your main.go, you should not delete the source files from src/go-package/math. Leave...
View ArticleHow to use self defined package
I have follow two simple go files main.go package main import "fmt" import "go-package/math" func main() { xs := []float64{1, 2, 3, 4} avg := math.Average(xs) fmt.Println(avg) } mymath.go package math...
View Article
More Pages to Explore .....