Embed file using golang embed filesystem#30
Open
yudhaputrama wants to merge 1 commit intogusaul:masterfrom
Open
Embed file using golang embed filesystem#30yudhaputrama wants to merge 1 commit intogusaul:masterfrom
yudhaputrama wants to merge 1 commit intogusaul:masterfrom
Conversation
Author
|
I prefer binary can run at any folder so I don't need to copy all the assets to same folder |
gusaul
requested changes
May 19, 2021
| ) | ||
|
|
||
| func main() { | ||
| flag.StringVar(&logfile, "log", "", "Specify log file") |
Owner
There was a problem hiding this comment.
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 != "" { |
Owner
There was a problem hiding this comment.
dont need to check if have default value
| if value, ok := os.LookupEnv("BIND_ADDR"); ok { | ||
| addr = value | ||
| } | ||
| addr := fmt.Sprintf(":%d", port) |
Owner
There was a problem hiding this comment.
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
Owner
|
@yudhaputrama please check the comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
-portdefault still6969-log