lab001

command
v0.0.0-...-f10d331 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2023 License: MIT Imports: 3 Imported by: 0

README

实验1,net.InterfaceAddrs,去除回环地址和ipv6

net.InterfaceAddrs会返回本机的所有地址。代码中有去掉回环地址和ipv6

注意点

这个代码虽然去掉了回环地址和ipv6的地址,但是因为我们要是用到了虚拟机和docker, 我们的机器上都会多一个虚拟网卡,这个地址用这个代码是去不掉的。

运行结果

Imgur

参考资料

http://golangtc.com/t/5111b98b320b5209f4000004

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL