-
Notifications
You must be signed in to change notification settings - Fork 8
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
Use staticcheck #201
Use staticcheck #201
Conversation
5a8f843
to
31b1f04
Compare
Signed-off-by: Masayuki Ishii <masa213f@gmail.com>
Signed-off-by: Masayuki Ishii <masa213f@gmail.com>
Signed-off-by: Masayuki Ishii <masa213f@gmail.com>
Signed-off-by: Masayuki Ishii <masa213f@gmail.com>
Signed-off-by: Masayuki Ishii <masa213f@gmail.com>
49b82c7
to
e1a14c7
Compare
Signed-off-by: Masayuki Ishii <masa213f@gmail.com>
e1a14c7
to
cec82ab
Compare
Signed-off-by: Yusuke Suzuki <yusuke-suzuki@cybozu.co.jp>
@@ -19,21 +19,15 @@ import ( | |||
|
|||
const ( | |||
// ExitSuccess represents no error. | |||
ExitSuccess subcommands.ExitStatus = subcommands.ExitSuccess |
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.
Please get rid of github.com/google/subcommands
as it was replaced with cobra.
models/etcd/dhcp.go
Outdated
if l.hwMap == nil { | ||
return json.Marshal(make(map[string]leaseInfo)) | ||
} |
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.
unnecessary.
Co-authored-by: Yamamoto, Hirotaka <ymmt2005@gmail.com>
Signed-off-by: Yusuke Suzuki <yusuke-suzuki@cybozu.co.jp>
Signed-off-by: Yusuke Suzuki <yusuke-suzuki@cybozu.co.jp>
models/etcd/dhcp.go
Outdated
if l.hwMap == nil { | ||
l.hwMap = make(map[string]leaseInfo) | ||
} | ||
|
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.
In some cases, hwmap will be nil, so we initialize it 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.
Why do you want to initialize it here?
I think it can be initialized where a new key is stored in this map.
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.
I think it is better to allocate the map when initializing the "leaseUsage" structure.
In this case, in effect, this unmarshaller initializes the structure, so we're allocating the map here.
Signed-off-by: Masayuki Ishii <masa213f@gmail.com>
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
This PR modifies the followings