简体   繁体   中英

read golang source code by Visual Studio Code ,compiler warning,how to fix it

download source code

git clone https://github.com/golang/go.git  golang


open golang by Visual Studio Code,the waring info在此处输入图像描述

在此处输入图像描述

I try open bufio 在此处输入图像描述

so how to fix it

Following the given link in your error: Setting up your workspace

As of Jan 2021, if you are working with multiple modules or nested modules, you will need to create a "workspace folder" for each module. This means that each module has its own scope, and features will not work across modules. We are currently working on addressing this limitation--see details about experimental workspace module mode below.

In VS Code, you can create a workspace folder by setting up a multi-root workspace. View the documentation for your editor plugin to learn how to configure a workspace folder in your editor.

And then following this link:multi-root workspace

You will see how to add a folder to the workspace. So basically doing this at VS Code, solved the problem:

File > Add Folder To Workspace > "select the desired folders"

However, it seems to me that what you are trying to do is to install Go from source. If that is what you are aiming to, you should strictly follow the documentation and execute this installation at your GOROOT: Install-Go-From-Source

At the all.bash script in the documentation you will see a line like this:

echo 'all.bash must be run from $GOROOT/src' 1>&2

Or follow this docs if you want to contribute with Go source code: Contribution Guidelines

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM