起步
在使用 go-micro 之前,我们需要做一些环境准备。
$ go get github.com/micro/protoc-gen-micro/v2
$ go get -u github.com/golang/protobuf/protoc-gen-go
然后安装 protoc,这是软件下载连接。我用的操作系统是 centos 7,因此下载的是:protoc-3.11.4-linux-x86_64.zip。
在使用 go-micro 之前,我们需要做一些环境准备。
$ go get github.com/micro/protoc-gen-micro/v2
$ go get -u github.com/golang/protobuf/protoc-gen-go
然后安装 protoc,这是软件下载连接。我用的操作系统是 centos 7,因此下载的是:protoc-3.11.4-linux-x86_64.zip。
当使用 fetch 函数做跨域请求时,大概率会在浏览器 Console 中看到这样一个错误信息:Access to fetch at 'xxx' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
。