libnetwork/drivers: rewrite some strings to reduce quote-escaping

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-07-16 18:21:33 +02:00
parent 7c360778bb
commit 534858aaed
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
4 changed files with 7 additions and 7 deletions

View file

@ -52,7 +52,7 @@ func TestSetupNewNonDefaultBridge(t *testing.T) {
err = setupDevice(config, br)
if err == nil {
t.Fatal("Expected bridge creation failure with \"non default name\", succeeded")
t.Fatal(`Expected bridge creation failure with "non default name", succeeded`)
}
if _, ok := err.(NonDefaultBridgeExistError); !ok {

View file

@ -43,7 +43,7 @@ func (d *driver) CreateNetwork(id string, option map[string]interface{}, nInfo d
defer d.Unlock()
if d.network != "" {
return types.ForbiddenErrorf("only one instance of \"%s\" network is allowed", NetworkType)
return types.ForbiddenErrorf("only one instance of %q network is allowed", NetworkType)
}
d.network = id
@ -52,7 +52,7 @@ func (d *driver) CreateNetwork(id string, option map[string]interface{}, nInfo d
}
func (d *driver) DeleteNetwork(nid string) error {
return types.ForbiddenErrorf("network of type \"%s\" cannot be deleted", NetworkType)
return types.ForbiddenErrorf("network of type %q cannot be deleted", NetworkType)
}
func (d *driver) CreateEndpoint(nid, eid string, ifInfo driverapi.InterfaceInfo, epOptions map[string]interface{}) error {

View file

@ -43,7 +43,7 @@ func (d *driver) CreateNetwork(id string, option map[string]interface{}, nInfo d
defer d.Unlock()
if d.network != "" {
return types.ForbiddenErrorf("only one instance of \"%s\" network is allowed", NetworkType)
return types.ForbiddenErrorf("only one instance of %q network is allowed", NetworkType)
}
d.network = id
@ -52,7 +52,7 @@ func (d *driver) CreateNetwork(id string, option map[string]interface{}, nInfo d
}
func (d *driver) DeleteNetwork(nid string) error {
return types.ForbiddenErrorf("network of type \"%s\" cannot be deleted", NetworkType)
return types.ForbiddenErrorf("network of type %q cannot be deleted", NetworkType)
}
func (d *driver) CreateEndpoint(nid, eid string, ifInfo driverapi.InterfaceInfo, epOptions map[string]interface{}) error {

View file

@ -43,14 +43,14 @@ func TestAppendVNIList(t *testing.T) {
slice: []uint32{4, 5, 6},
csv: "1,2,3,abc",
want: []uint32{4, 5, 6, 1, 2, 3},
wantErr: "invalid vxlan id value \"abc\" passed",
wantErr: `invalid vxlan id value "abc" passed`,
},
{
name: "InvalidVNI2",
slice: []uint32{4, 5, 6},
csv: "abc,1,2,3",
want: []uint32{4, 5, 6},
wantErr: "invalid vxlan id value \"abc\" passed",
wantErr: `invalid vxlan id value "abc" passed`,
},
}
for _, tt := range cases {