Quantcast
Channel: How to use self defined package - Stack Overflow
Browsing all 2 articles
Browse latest View live

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 Article



How 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
Browsing all 2 articles
Browse latest View live




Latest Images