import ( "github.com/docker/libnetwork/network" ) // Create a new network named "my-network" nw, err := network.NewNetwork("my-network") if err != nil { // Handle error }
import ( "github.com/docker/libnetwork/network" ) // Get information about the "my-network" network nw, err := network.GetNetwork("my-network") if err != nil { // Handle error } // Do something with the network informationOverall, the Network Name feature provided by `github.com/docker/libnetwork` makes it easy to manage containers and their associated networks in a customized and intuitive way.