Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
cosnicolaou committed Oct 8, 2024
1 parent e203806 commit df758a8
Show file tree
Hide file tree
Showing 113 changed files with 735 additions and 732 deletions.
10 changes: 5 additions & 5 deletions v23/flow/message/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,11 @@ func (m Setup) ReadDirect(ctx *context.T, orig []byte) (Setup, error) {
if v, data, valid = readVarUint64(data); !valid {
return Setup{}, NewErrInvalidMsg(ctx, SetupType, uint64(len(orig)), 0, nil)
}
m.Versions.Min = version.RPCVersion(v)
m.Versions.Min = version.RPCVersion(v) //nolint:gosec // disable G115
if v, data, valid = readVarUint64(data); !valid {
return Setup{}, NewErrInvalidMsg(ctx, SetupType, uint64(len(orig)), 1, nil)
}
m.Versions.Max = version.RPCVersion(v)
m.Versions.Max = version.RPCVersion(v) //nolint:gosec // disable G115
for field := uint64(2); len(data) > 0; field++ {
var (
payload []byte
Expand Down Expand Up @@ -687,11 +687,11 @@ func (m ProxyResponse) Read(ctx *context.T, orig []byte) (Message, error) {
m.Endpoints = make([]naming.Endpoint, 0, len(data))
for i := 0; len(data) > 0; i++ {
if epBytes, data, valid = readLenBytes(data); !valid {
return ProxyResponse{}, NewErrInvalidMsg(ctx, ProxyResponseType, uint64(len(orig)), uint64(i), nil)
return ProxyResponse{}, NewErrInvalidMsg(ctx, ProxyResponseType, uint64(len(orig)), uint64(i), nil) //nolint:gosec // disable G115
}
ep, err := naming.ParseEndpoint(string(epBytes))
if err != nil {
return ProxyResponse{}, NewErrInvalidMsg(ctx, ProxyResponseType, uint64(len(orig)), uint64(i), err)
return ProxyResponse{}, NewErrInvalidMsg(ctx, ProxyResponseType, uint64(len(orig)), uint64(i), err) //nolint:gosec // disable G115
}
m.Endpoints = append(m.Endpoints, ep)
}
Expand Down Expand Up @@ -879,7 +879,7 @@ func writeVarUint64(u uint64, buf []byte) []byte {
byte((u&0xff0000)>>16),
byte((u&0xff00)>>8),
byte(u&0xff))
case u <= 0xffffffffffffffff:
case u <= 0xffffffffffffffff: //nolint:staticcheck // disable SA4003
// Note that using a default statement is significantly slower.
return append(buf, 0xff-7,
byte((u&0xff00000000000000)>>56),
Expand Down
2 changes: 1 addition & 1 deletion v23/naming/naming.vdl.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (x *MountFlag) VDLRead(dec vdl.Decoder) error { //nolint:gocyclo
case err != nil:
return err
default:
*x = MountFlag(value)
*x = MountFlag(value) //nolint:gosec // disable G115
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion v23/query/engine/internal/queryparser/query_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -1445,7 +1445,7 @@ func ConvertValueToAnOperand(value *vdl.Value, off int64) (*Operand, error) {
op.Int = value.Int()
case vdl.Byte, vdl.Uint16, vdl.Uint32, vdl.Uint64:
op.Type = TypInt
op.Int = int64(value.Uint())
op.Int = int64(value.Uint()) //nolint:gosec // disable G115
case vdl.Float32, vdl.Float64:
op.Type = TypFloat
op.Float = value.Float()
Expand Down
50 changes: 25 additions & 25 deletions v23/query/engine/internal/testdata/testdata.vdl.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ func (x *RatingsArray) VDLRead(dec vdl.Decoder) error { //nolint:gocyclo
case done:
return fmt.Errorf("short array, got len %d < 4 %T)", index, *x)
default:
x[index] = int16(elem)
x[index] = int16(elem) //nolint:gosec // disable G115
}
}
switch done, err := dec.NextEntry(); {
Expand Down Expand Up @@ -453,7 +453,7 @@ func (x *EquifaxCreditReport) VDLRead(dec vdl.Decoder) error { //nolint:gocyclo
case err != nil:
return err
default:
x.Rating = byte(value)
x.Rating = byte(value) //nolint:gosec // disable G115
}
case 1:
if err := x.FourScoreRatings.VDLRead(dec); err != nil {
Expand Down Expand Up @@ -782,7 +782,7 @@ func (x *TransUnionCreditReport) VDLRead(dec vdl.Decoder) error { //nolint:gocyc
case err != nil:
return err
default:
x.Rating = int16(value)
x.Rating = int16(value) //nolint:gosec // disable G115
}
case 1:
if err := vdlReadAnonMap2(dec, &x.PreviousRatings); err != nil {
Expand Down Expand Up @@ -813,7 +813,7 @@ func vdlReadAnonMap2(dec vdl.Decoder, x *map[string]int16) error {
case err != nil:
return err
default:
elem = int16(value)
elem = int16(value) //nolint:gosec // disable G115
}
if tmpMap == nil {
tmpMap = make(map[string]int16)
Expand Down Expand Up @@ -1503,21 +1503,21 @@ func (x *Numbers) VDLRead(dec vdl.Decoder) error { //nolint:gocyclo
case err != nil:
return err
default:
x.B = byte(value)
x.B = byte(value) //nolint:gosec // disable G115
}
case 1:
switch value, err := dec.ReadValueUint(16); {
case err != nil:
return err
default:
x.Ui16 = uint16(value)
x.Ui16 = uint16(value) //nolint:gosec // disable G115
}
case 2:
switch value, err := dec.ReadValueUint(32); {
case err != nil:
return err
default:
x.Ui32 = uint32(value)
x.Ui32 = uint32(value) //nolint:gosec // disable G115
}
case 3:
switch value, err := dec.ReadValueUint(64); {
Expand All @@ -1531,14 +1531,14 @@ func (x *Numbers) VDLRead(dec vdl.Decoder) error { //nolint:gocyclo
case err != nil:
return err
default:
x.I16 = int16(value)
x.I16 = int16(value) //nolint:gosec // disable G115
}
case 5:
switch value, err := dec.ReadValueInt(32); {
case err != nil:
return err
default:
x.I32 = int32(value)
x.I32 = int32(value) //nolint:gosec // disable G115
}
case 6:
switch value, err := dec.ReadValueInt(64); {
Expand All @@ -1552,7 +1552,7 @@ func (x *Numbers) VDLRead(dec vdl.Decoder) error { //nolint:gocyclo
case err != nil:
return err
default:
x.F32 = float32(value)
x.F32 = float32(value) //nolint:gosec // disable G115
}
case 8:
switch value, err := dec.ReadValueFloat(64); {
Expand Down Expand Up @@ -1969,7 +1969,7 @@ func (x *K) VDLRead(dec vdl.Decoder) error { //nolint:gocyclo
case err != nil:
return err
default:
x.A = byte(value)
x.A = byte(value) //nolint:gosec // disable G115
}
case 1:
switch value, err := dec.ReadValueString(); {
Expand Down Expand Up @@ -2052,7 +2052,7 @@ func (x *V) VDLRead(dec vdl.Decoder) error { //nolint:gocyclo
case err != nil:
return err
default:
x.B = float32(value)
x.B = float32(value) //nolint:gosec // disable G115
}
}
}
Expand Down Expand Up @@ -2295,7 +2295,7 @@ func vdlReadAnonMap5(dec vdl.Decoder, x *map[int16][]map[string]struct{}) error
if tmpMap == nil {
tmpMap = make(map[int16][]map[string]struct{})
}
tmpMap[int16(key)] = elem
tmpMap[int16(key)] = elem //nolint:gosec // disable G115
}
}
}
Expand Down Expand Up @@ -3029,7 +3029,7 @@ func vdlReadAnonMap9(dec vdl.Decoder, x *map[byte]string) error {
if tmpMap == nil {
tmpMap = make(map[byte]string)
}
tmpMap[byte(key)] = elem
tmpMap[byte(key)] = elem //nolint:gosec // disable G115
}
}
}
Expand Down Expand Up @@ -3060,7 +3060,7 @@ func vdlReadAnonMap10(dec vdl.Decoder, x *map[uint16]string) error {
if tmpMap == nil {
tmpMap = make(map[uint16]string)
}
tmpMap[uint16(key)] = elem
tmpMap[uint16(key)] = elem //nolint:gosec // disable G115
}
}
}
Expand Down Expand Up @@ -3091,7 +3091,7 @@ func vdlReadAnonMap11(dec vdl.Decoder, x *map[uint32]string) error {
if tmpMap == nil {
tmpMap = make(map[uint32]string)
}
tmpMap[uint32(key)] = elem
tmpMap[uint32(key)] = elem //nolint:gosec // disable G115
}
}
}
Expand Down Expand Up @@ -3153,7 +3153,7 @@ func vdlReadAnonMap13(dec vdl.Decoder, x *map[int16]string) error {
if tmpMap == nil {
tmpMap = make(map[int16]string)
}
tmpMap[int16(key)] = elem
tmpMap[int16(key)] = elem //nolint:gosec // disable G115
}
}
}
Expand Down Expand Up @@ -3184,7 +3184,7 @@ func vdlReadAnonMap14(dec vdl.Decoder, x *map[int32]string) error {
if tmpMap == nil {
tmpMap = make(map[int32]string)
}
tmpMap[int32(key)] = elem
tmpMap[int32(key)] = elem //nolint:gosec // disable G115
}
}
}
Expand Down Expand Up @@ -3246,7 +3246,7 @@ func vdlReadAnonMap16(dec vdl.Decoder, x *map[float32]string) error {
if tmpMap == nil {
tmpMap = make(map[float32]string)
}
tmpMap[float32(key)] = elem
tmpMap[float32(key)] = elem //nolint:gosec // disable G115
}
}
}
Expand Down Expand Up @@ -3870,7 +3870,7 @@ func vdlReadAnonSet22(dec vdl.Decoder, x *map[byte]struct{}) error {
if tmpMap == nil {
tmpMap = make(map[byte]struct{})
}
tmpMap[byte(key)] = struct{}{}
tmpMap[byte(key)] = struct{}{} //nolint:gosec // disable G115
}
}
}
Expand All @@ -3894,7 +3894,7 @@ func vdlReadAnonSet23(dec vdl.Decoder, x *map[uint16]struct{}) error {
if tmpMap == nil {
tmpMap = make(map[uint16]struct{})
}
tmpMap[uint16(key)] = struct{}{}
tmpMap[uint16(key)] = struct{}{} //nolint:gosec // disable G115
}
}
}
Expand All @@ -3918,7 +3918,7 @@ func vdlReadAnonSet24(dec vdl.Decoder, x *map[uint32]struct{}) error {
if tmpMap == nil {
tmpMap = make(map[uint32]struct{})
}
tmpMap[uint32(key)] = struct{}{}
tmpMap[uint32(key)] = struct{}{} //nolint:gosec // disable G115
}
}
}
Expand Down Expand Up @@ -3966,7 +3966,7 @@ func vdlReadAnonSet26(dec vdl.Decoder, x *map[int16]struct{}) error {
if tmpMap == nil {
tmpMap = make(map[int16]struct{})
}
tmpMap[int16(key)] = struct{}{}
tmpMap[int16(key)] = struct{}{} //nolint:gosec // disable G115
}
}
}
Expand All @@ -3990,7 +3990,7 @@ func vdlReadAnonSet27(dec vdl.Decoder, x *map[int32]struct{}) error {
if tmpMap == nil {
tmpMap = make(map[int32]struct{})
}
tmpMap[int32(key)] = struct{}{}
tmpMap[int32(key)] = struct{}{} //nolint:gosec // disable G115
}
}
}
Expand Down Expand Up @@ -4038,7 +4038,7 @@ func vdlReadAnonSet29(dec vdl.Decoder, x *map[float32]struct{}) error {
if tmpMap == nil {
tmpMap = make(map[float32]struct{})
}
tmpMap[float32(key)] = struct{}{}
tmpMap[float32(key)] = struct{}{} //nolint:gosec // disable G115
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion v23/query/engine/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3314,7 +3314,7 @@ func TestExecErrors(t *testing.T) {
_, _, err := qe.Exec(test.query)
// Test both that the IDs compare and the text compares (since the offset needs to match).
if !errors.Is(err, test.err) || err.Error() != test.err.Error() {
t.Logf(verror.DebugString(err))
t.Logf("%s", verror.DebugString(err))
t.Errorf("query: %s; got %v, want %v", test.query, err, test.err)
}
}
Expand Down
4 changes: 2 additions & 2 deletions v23/query/pattern/pattern.vdl.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var (

// ErrorfIllegalEscapeChar calls ErrIllegalEscapeChar.Errorf with the supplied arguments.
func ErrorfIllegalEscapeChar(ctx *context.T, format string) error {
return ErrIllegalEscapeChar.Errorf(ctx, format)
return ErrIllegalEscapeChar.Errorf(ctx, format) //nolint:govet // non-constant format string
}

// MessageIllegalEscapeChar calls ErrIllegalEscapeChar.Message with the supplied arguments.
Expand All @@ -54,7 +54,7 @@ func ParamsErrIllegalEscapeChar(argumentError error) (verrorComponent string, ve

// ErrorfInvalidEscape calls ErrInvalidEscape.Errorf with the supplied arguments.
func ErrorfInvalidEscape(ctx *context.T, format string, escaped string) error {
return ErrInvalidEscape.Errorf(ctx, format, escaped)
return ErrInvalidEscape.Errorf(ctx, format, escaped) //nolint:govet // non-constant format string
}

// MessageInvalidEscape calls ErrInvalidEscape.Message with the supplied arguments.
Expand Down
Loading

0 comments on commit df758a8

Please sign in to comment.