mirror of
https://github.com/sony/sonyflake.git
synced 2026-11-27 16:36:29 +00:00
Fix default machine ID to respect BitsMachineID setting
Co-authored-by: YoshiyukiMineo <7577673+YoshiyukiMineo@users.noreply.github.com>
This commit is contained in:
1 parent
806997932e
commit
f8ce8840b5
3 files changed
+102
-1
No files matched your search
@@ -34,3 +34,13 @@ func NewNilInterfaceAddrs() types.InterfaceAddrs {
|
||||
return []net.Addr{}, nil
|
||||
}
|
||||
}
|
||||
|
||||
// NewInterfaceAddrsWithIP returns a private IP address with the given IP.
|
||||
func NewInterfaceAddrsWithIP(ip net.IP) types.InterfaceAddrs {
|
||||
ifat := make([]net.Addr, 0, 1)
|
||||
ifat = append(ifat, &net.IPNet{IP: ip, Mask: []byte{255, 0, 0, 0}})
|
||||
|
||||
return func() ([]net.Addr, error) {
|
||||
return ifat, nil
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user