import ( etcd "github.com/coreos/go-etcd/etcd" ) func main() { client := etcd.NewClient([]string{"http://localhost:4001"}) _, err := client.Set("/key", "value", 0) if err != nil { fmt.Println(err) } }
import ( etcd "github.com/coreos/go-etcd/etcd" ) func main() { client := etcd.NewClient([]string{"http://localhost:4001"}) response, err := client.Get("/key", false, false) if err != nil { fmt.Println(err) } fmt.Println(response.Node.Value) }
import ( etcd "github.com/coreos/go-etcd/etcd" ) func main() { client := etcd.NewClient([]string{"http://localhost:4001"}) watchChan := client.Watch("/key", 0, false) for { select { case response := <-watchChan: fmt.Println(response.Node.Value) } } }It is evident that the package used in these examples is go-etcd.etcd Client, as the import statement in all examples has the same package name.