mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Resolve stringer TODO
PiperOrigin-RevId: 240224782 Change-Id: Iab4e4e7047b2d022f15e807c2348685d8e972020
This commit is contained in:
committed by
Shentubot
parent
f3723f8059
commit
23a5306b5c
+2
-4
@@ -39,8 +39,7 @@ func (cfg *Config) decode(opts []option) error {
|
||||
for _, opt := range opts {
|
||||
b := opt.body
|
||||
if !opt.code.lenValid(len(b)) {
|
||||
// TODO: s/%v/%s/ when `go vet` is smarter.
|
||||
return fmt.Errorf("%v: bad length: %d", opt.code, len(b))
|
||||
return fmt.Errorf("%s: bad length: %d", opt.code, len(b))
|
||||
}
|
||||
switch opt.code {
|
||||
case optLeaseTime:
|
||||
@@ -231,8 +230,7 @@ func (opts options) dhcpMsgType() (dhcpMsgType, error) {
|
||||
for _, opt := range opts {
|
||||
if opt.code == optDHCPMsgType {
|
||||
if len(opt.body) != 1 {
|
||||
// TODO: s/%v/%s/ when `go vet` is smarter.
|
||||
return 0, fmt.Errorf("%v: bad length: %d", opt.code, len(opt.body))
|
||||
return 0, fmt.Errorf("%s: bad length: %d", opt.code, len(opt.body))
|
||||
}
|
||||
v := opt.body[0]
|
||||
if v <= 0 || v >= 8 {
|
||||
|
||||
Reference in New Issue
Block a user