MCPcopy
hub / github.com/IceWhaleTech/CasaOS / GetMacAddress

Method GetMacAddress

service/system.go:179–193  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

177}
178
179func (c *systemService) GetMacAddress() (string, error) {
180 interfaces, err := net.Interfaces()
181 if err != nil {
182 return "", err
183 }
184 nets := MyService.System().GetNet(true)
185 for _, v := range interfaces {
186 for _, n := range nets {
187 if v.Name == n {
188 return v.HardwareAddr, nil
189 }
190 }
191 }
192 return "", errors.New("not found")
193}
194
195func (c *systemService) MkdirAll(path string) (int, error) {
196 _, err := os.Stat(path)

Callers

nothing calls this directly

Calls 2

GetNetMethod · 0.65
SystemMethod · 0.65

Tested by

no test coverage detected