//// users/users.go
package users
type user struct {
name string
}
func New(name string) *user {
u := user{
name: name,
}
if name == "" {
u.name = "Nobody"
}
return &u
}
///// main.go
package main
import "github.com/yourproject/users"
func main() {
user := users.New("")
...........
}