You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
trying out one example, below are my files at a particular location
#config.gcfg
[production]
db-host = 127.0.0.1
db-password = hahahah
#main.go
package main
import "fmt"
import "gcfg"
func main() {
var cfg Config
err := gcfg.ReadFileInto(&cfg, "config.gcfg")
fmt.Println(cfg)
}
# and the output with `import "gcfg"` is
main.go:4:8: import "gcfg": cannot find package
# and the output without `import "gcfg"` is
# command-line-arguments
./main.go:6: undefined: Config
./main.go:7: undefined: gcfg
Original issue reported on code.google.com by amolpuj...@gmail.com on 27 Mar 2013 at 1:47
The text was updated successfully, but these errors were encountered:
Thanks for trying my package.
It seems that you have figured it out but I'll post it here for reference:
http://golang.org/cmd/go/#hdr-Remote_import_path_syntax
I omitted the import from the example on the project page as it is standard Go
convention.
For more real-world examples, you can search for programs using
"code.google.com/p/gcfg" on code sharing sites (e.g. github.com), here is one
example:
https://github.com/abh/geodns/blob/ab821f706123806ac910132b96170dd1bdbd138a/conf
ig.go
Original comment by speter....@gmail.com on 27 Mar 2013 at 11:41
Original issue reported on code.google.com by
amolpuj...@gmail.com
on 27 Mar 2013 at 1:47The text was updated successfully, but these errors were encountered: