github.com/niubaoshu/goutils@v0.0.0-20180828035119-e8e576f66c2b/net/getLocalIPAddrs_test.go (about)

     1  package net
     2  
     3  import (
     4  	"fmt"
     5  	"testing"
     6  )
     7  
     8  func TestGetLocalIPAddrs(t *testing.T) {
     9  	ips, err := GetLocalIPAddrs()
    10  	if err == nil {
    11  		for i := 0; i < len(ips); i++ {
    12  			fmt.Println(ips[i].String())
    13  		}
    14  	}
    15  }