-
Notifications
You must be signed in to change notification settings - Fork 36
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
fix: golangci-lint error #191
Conversation
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.
LGTM except one comment.
pkg/server/nfs/nfs_server.go
Outdated
@@ -163,7 +163,9 @@ func getUpdatedGaneshConfig(config []byte) []byte { | |||
LogPath: logPath, | |||
} | |||
|
|||
template.Must(template.New("Ganesha_Config").Parse(string(config))).Execute(&tmplBuf, tmplVals) | |||
if err := template.Must(template.New("Ganesha_Config").Parse(string(config))).Execute(&tmplBuf, tmplVals); err != nil { | |||
logrus.WithError(err).Fatal("Failed to parse ganesha config") |
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.
Let's return the error to let the caller handle instead of failing the program here.
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.
Since this function doesn't return error orginally, I update to log a warning message here. We can see whether to improve it if this error happens frequently.
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.
Signed-off-by: PoAn Yang <poan.yang@suse.com>
@mergify backport v1.6.x |
✅ Backports have been created
|
Which issue(s) this PR fixes:
longhorn/longhorn#7448
What this PR does / why we need it:
Special notes for your reviewer:
Additional documentation or context