23. Go - Creating Packages
1. Create folder "PACKAGENAME"
2. Create go file
package PACKAGENAME
import "fmt"
func printname(a string) {
fmt.Println(a)
}
3. Make linkable object file
go install
4. Import into another go as a package
package main
import m "UserData\VSCode\Go\test"
func main() {
m.printname("hello")
}
Comments
Post a Comment