1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/libnetwork/drivers/ipvlan
Chris Telfer 06922d2d81 Use fmt precision to limit string length
The previous code used string slices to limit the length of certain
fields like endpoint or sandbox IDs.  This assumes that these strings
are at least as long as the slice length.  Unfortunately, some sandbox
IDs can be smaller than 7 characters.   This fix addresses this issue
by systematically converting format string calls that were taking
fixed-slice arguments to use a precision specifier in the string format
itself.  From the golang fmt package documentation:

    For strings, byte slices and byte arrays, however, precision limits
    the length of the input to be formatted (not the size of the output),
    truncating if necessary. Normally it is measured in runes, but for
    these types when formatted with the %x or %X format it is measured
    in bytes.

This nicely fits the desired behavior: it will limit the number of
runes considered for string interpolation to the precision value.

Signed-off-by: Chris Telfer <ctelfer@docker.com>
2018-07-05 17:44:04 -04:00
..
ivmanager Adding manager pkg for swarm visible network drivers 2017-05-12 17:16:54 -07:00
ipvlan.go Add ConnectivityScope capability for network drivers along with scope network option 2017-05-12 17:16:34 -07:00
ipvlan_endpoint.go Use fmt precision to limit string length 2018-07-05 17:44:04 -04:00
ipvlan_joinleave.go Use fmt precision to limit string length 2018-07-05 17:44:04 -04:00
ipvlan_network.go Use fmt precision to limit string length 2018-07-05 17:44:04 -04:00
ipvlan_setup.go Fix type in error message 2018-05-29 08:56:49 -07:00
ipvlan_setup_test.go use grep to find a/an misuse 2016-06-03 16:35:33 +08:00
ipvlan_state.go Update logrus to v1.0.1 2017-08-07 11:20:47 -07:00
ipvlan_store.go Use fmt precision to limit string length 2018-07-05 17:44:04 -04:00
ipvlan_test.go Update plugingetter import path. 2016-10-07 12:00:57 -07:00