go is my first statically typed and compiled language so I am not sure about how to go about doing some things like writing packages...Should I write a package like...
package mypkg
import "fmt"
func mypkg {
fmt.Println("mypackage")
}
and then import this into the main package....install it and then test if it works?
Or should I write mypkg
like this...
package main
import "fmt"
func mypkg() {
fmt.Println("mypackage")
}
func main() {
mypkg()
}
Should I do it this way to make sure that I can call go run mypkg
and see if it works, then delete the main function and rename the package and then work on the rest of the library?
Or did I miss the point entirely and I should do something else?