Quantcast
Channel: How to use self defined package - Stack Overflow
Browsing latest articles
Browse All 2 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 latest articles
Browse All 2 View Live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>