88func TestShouldDiscardSolicitWithoutBootfileUrlOption (t * testing.T ) {
99 clientID := []byte ("clientid" )
1010 options := make (Options )
11- options .Add (& Option {ID : OptClientID , Length : uint16 (len (clientID )), Value : clientID })
11+ options .Add (& Option {ID : OptClientID , Length : uint16 (len (clientID )), Value : clientID }) // nolint:gosec
1212 solicit := & Packet {Type : MsgSolicit , TransactionID : [3 ]byte {'1' , '2' , '3' }, Options : options }
1313
1414 if err := shouldDiscardSolicit (solicit ); err == nil {
@@ -31,8 +31,8 @@ func TestShouldDiscardSolicitWithServerIdOption(t *testing.T) {
3131 clientID := []byte ("clientid" )
3232 options := make (Options )
3333 options .Add (MakeOptionRequestOptions ([]uint16 {OptBootfileURL }))
34- options .Add (& Option {ID : OptClientID , Length : uint16 (len (clientID )), Value : clientID })
35- options .Add (& Option {ID : OptServerID , Length : uint16 (len (serverID )), Value : serverID })
34+ options .Add (& Option {ID : OptClientID , Length : uint16 (len (clientID )), Value : clientID }) // nolint:gosec
35+ options .Add (& Option {ID : OptServerID , Length : uint16 (len (serverID )), Value : serverID }) // nolint:gosec
3636 solicit := & Packet {Type : MsgSolicit , TransactionID : [3 ]byte {'1' , '2' , '3' }, Options : options }
3737
3838 if err := shouldDiscardSolicit (solicit ); err == nil {
@@ -44,8 +44,8 @@ func TestShouldDiscardRequestWithoutBootfileUrlOption(t *testing.T) {
4444 serverID := []byte ("serverid" )
4545 clientID := []byte ("clientid" )
4646 options := make (Options )
47- options .Add (& Option {ID : OptClientID , Length : uint16 (len (clientID )), Value : clientID })
48- options .Add (& Option {ID : OptServerID , Length : uint16 (len (serverID )), Value : serverID })
47+ options .Add (& Option {ID : OptClientID , Length : uint16 (len (clientID )), Value : clientID }) // nolint:gosec
48+ options .Add (& Option {ID : OptServerID , Length : uint16 (len (serverID )), Value : serverID }) // nolint:gosec
4949 request := & Packet {Type : MsgRequest , TransactionID : [3 ]byte {'1' , '2' , '3' }, Options : options }
5050
5151 if err := shouldDiscardRequest (request , serverID ); err == nil {
@@ -57,7 +57,7 @@ func TestShouldDiscardRequestWithoutClientIdOption(t *testing.T) {
5757 serverID := []byte ("serverid" )
5858 options := make (Options )
5959 options .Add (MakeOptionRequestOptions ([]uint16 {OptBootfileURL }))
60- options .Add (& Option {ID : OptServerID , Length : uint16 (len (serverID )), Value : serverID })
60+ options .Add (& Option {ID : OptServerID , Length : uint16 (len (serverID )), Value : serverID }) // nolint:gosec
6161 request := & Packet {Type : MsgRequest , TransactionID : [3 ]byte {'1' , '2' , '3' }, Options : options }
6262
6363 if err := shouldDiscardRequest (request , serverID ); err == nil {
@@ -69,7 +69,7 @@ func TestShouldDiscardRequestWithoutServerIdOption(t *testing.T) {
6969 clientID := []byte ("clientid" )
7070 options := make (Options )
7171 options .Add (MakeOptionRequestOptions ([]uint16 {OptBootfileURL }))
72- options .Add (& Option {ID : OptClientID , Length : uint16 (len (clientID )), Value : clientID })
72+ options .Add (& Option {ID : OptClientID , Length : uint16 (len (clientID )), Value : clientID }) // nolint:gosec
7373 request := & Packet {Type : MsgRequest , TransactionID : [3 ]byte {'1' , '2' , '3' }, Options : options }
7474
7575 if err := shouldDiscardRequest (request , []byte ("serverid" )); err == nil {
@@ -82,8 +82,8 @@ func TestShouldDiscardRequestWithWrongServerId(t *testing.T) {
8282 serverID := []byte ("serverid" )
8383 options := make (Options )
8484 options .Add (MakeOptionRequestOptions ([]uint16 {OptBootfileURL }))
85- options .Add (& Option {ID : OptClientID , Length : uint16 (len (clientID )), Value : clientID })
86- options .Add (& Option {ID : OptServerID , Length : uint16 (len (serverID )), Value : serverID })
85+ options .Add (& Option {ID : OptClientID , Length : uint16 (len (clientID )), Value : clientID }) // nolint:gosec
86+ options .Add (& Option {ID : OptServerID , Length : uint16 (len (serverID )), Value : serverID }) // nolint:gosec
8787 request := & Packet {Type : MsgRequest , TransactionID : [3 ]byte {'1' , '2' , '3' }, Options : options }
8888
8989 if err := shouldDiscardRequest (request , []byte ("wrongid" )); err == nil {
@@ -97,5 +97,5 @@ func MakeOptionRequestOptions(options []uint16) *Option {
9797 binary .BigEndian .PutUint16 (value [i * 2 :], option )
9898 }
9999
100- return & Option {ID : OptOro , Length : uint16 (len (options ) * 2 ), Value : value }
100+ return & Option {ID : OptOro , Length : uint16 (len (options ) * 2 ), Value : value } // nolint:gosec
101101}
0 commit comments