MCPcopy
hub / github.com/docker/compose / parseMACAddr

Function parseMACAddr

pkg/compose/create.go:1755–1764  ·  view source on GitHub ↗
(macAddress string)

Source from the content-addressed store, hash-verified

1753}
1754
1755func parseMACAddr(macAddress string) (network.HardwareAddr, error) {
1756 if macAddress == "" {
1757 return nil, nil
1758 }
1759 m, err := net.ParseMAC(macAddress)
1760 if err != nil {
1761 return nil, fmt.Errorf("invalid MAC address: %w", err)
1762 }
1763 return network.HardwareAddr(m), nil
1764}

Callers 2

createEndpointSettingsFunction · 0.85
defaultNetworkSettingsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected