-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Embed file using golang embed filesystem #30
base: master
Are you sure you want to change the base?
Conversation
I prefer binary can run at any folder so I don't need to copy all the assets to same folder |
func main() { | ||
flag.StringVar(&logfile, "log", "", "Specify log file") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should have default value to log/grpcox.log
f, err := os.OpenFile("log/grpcox.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) | ||
if err != nil { | ||
log.Fatalf("error opening file: %v", err) | ||
if logfile != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont need to check if have default value
if value, ok := os.LookupEnv("BIND_ADDR"); ok { | ||
addr = value | ||
} | ||
addr := fmt.Sprintf(":%d", port) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is breaking changes, we use env variable as config now, its should not completely replace, just make it replace if only being set by flag args
@yudhaputrama please check the comment |
Changes
-port
default still6969
-log