Skip to content

Instantly share code, notes, and snippets.

@nicklaw5
Last active October 14, 2016 22:28
Show Gist options
  • Save nicklaw5/7f766323acdf4a1472eb3b6d25adc9fd to your computer and use it in GitHub Desktop.
Save nicklaw5/7f766323acdf4a1472eb3b6d25adc9fd to your computer and use it in GitHub Desktop.
Go question
// file exists in go-ku/flag/flag.go
package flag
import "flag"
// Flagset inherits the default FlagSet
type Flagset struct {
*flag.FlagSet
}
// Parse overrides the default Parse() function
func (f *Flagset) Parse() {
f.Parse()
}
// file exists in go-ku/main.go
package main
import "github.com/nicklaw5/go-ku/flag"
var configFilePath = flag.String("config", "config/conf.toml", "The file path to the config file, realive to the project root.")
func main() {
flag.Parse()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment