cd config-srv
go run main.go
go run client/main.go
切到config-srv/conf目录,改动micro.yml文件的任意值。
比如
micro:
name: Micro
version: 1.0.0
hi: hello
改成
micro:
name: Micro
version: 1.0.0
hi: I am fine
客户端会打印:
2019/04/28 10:57:15 Watch changes: {"hi":"I am fine","name":"Micro","version":"1.0.0"}