vscode + golang encountered problems and solutions

  1. vscode go in the plug-in is related to the wall
    http://www.pythonsite.com/?p=429
    is already downloaded OK, but not quite right directory, change it to ok
  2. protoc --go_out = * .proto run error.
    Error: protoc-gen-go: program not found or is not executable --go_out: protoc-gen-go: Plugin failed with status code 1.
    solution:
    copy the executable to / usr / local / bin under
    solution
  3. Add a temporary environment variables:
    command line input
export GOPATH=/Users/leafs99/go

After reload, there is no

  1. git push has been withdrawn to a remote commit
    now to fall back to the appropriate local version
git reset --hard <版本号>
// 注意使用 --hard 参数会抛弃当前工作区的修改
// 使用 --soft 参数的话会回退到之前的版本,但是保留当前工作区的修改,可以重新提交

To overwrite the remote version information, the remote warehouse also roll back the appropriate version, you need to add parameters --force

git push origin <分支名> --force

https://blog.csdn.net/xs20691718/article/details/51901161

  1. string storage unicode, subscript not visit Chinese
    with a string stored in unicode, not visit with Chinese index to gain access to Chinese, use rune slices, so you can access the index
    https://www.golangtc.com/ t / 528cc004320b52227200000f

Guess you like

Origin www.cnblogs.com/leafs99/p/golang_vscode-01.html