Category: Go 1.13
-
Post Views: 65 1. Reference URL: https://github.com/unknwon/the-way-to-go_zh_en/blob/master/ebook/09.11.md . Test by browsing the page of http://localhost:8080/. Enter: http://www.destandaard.be in shorten this, and click: Give me the short URL. Loading until timeout. as shown in Figure 1 2. Check the terminal output and report an error: Runtime Error: Invalid memory address or nil pointer dereference. as shown in Figure 2 3. Check…
-
Post Views: 17 1. Invoke the following command in the terminal to install the API: go install google.golang.org/api/urlshortener/v1, error: cant load package: package google.golang.org/api/urlshortener/v1. as shown in Figure 1 2. Reference:https://github.com/googleapis/google-api-go-client/blob/master/GettingStarted.md. Invoke the following commands in the terminal to install the API: go get -u google.golang.org/api/urlshortener/v1, error: Package google.golang.org/api/urlshortener/v1: unrecognized import path “google.golang.org/api/urlshortener/v1”. as shown in Figure 2 3. Reference:https://www.shuijingwanwq.com/2019/12/28/3784/.…
-
Post Views: 14 1. Reference URL:https://www.shuijingwanwq.com/2020/07/02/4288/. Previously, the code file could only be placed below: C:\Users\Administrator\Go\Src. Put it in: E:\wwwroot\go\src will report an error. 2. Edit the environment variable – the user variable of Administrator – GOPATH, its original value is: C:\Users\Administrator\Go, create a new: E:\wwwroot\go. Its new value is: C:\Users\Administrator\Go;E:\wwwroot\go. as shown in Figure 1 3. Reference URL:https://github.com/unknwon/the-way-to-go_ZH_CN/blob/master/eBook/09.8.md. Compile…
-
Post Views: 15 1. Error in Go: package_mytest.go:5:2: cannot find package “.” in: E:\WWWRoot\Go\The-way-to-go\package\pack1. as shown in Figure 1 2. Check the code of pack1.go 3. Check the code of package_mytest.go 4. Check the environment variables – the user variables of the administrator – GOPATH, whose values are: C:\Users\Administrator\Go, as shown in Figure 2 5. Compile and install a package.…
-
Post Views: 15 1. Error in Go: package_mytest.go:5:2: cannot find package “.” in: E:\WWWRoot\Go\The-way-to-go\package\pack1. as shown in Figure 1 2. Check the code of pack1.go 3. Check the code of package_mytest.go 4. Check the environment variables – the user variables of the administrator – GOPATH, whose values are: C:\Users\Administrator\Go, as shown in Figure 2 5. Compile and install a package.…
-
Post Views: 15 1. The Go doc tool can only obtain the comments in ../go/src in the go installation directory. In addition, it can also be used as a local document to browse the web server. Enter godoc -http=:6060 on the command line and open it with a browserhttp://localhost:6060After that, you can see the page provided by the local document…
-
Post Views: 11 1. Refer to the Go guide, web server, write file: web-servers.go 2. Accesshttp://localhost:4000/When prompted: The website cannot be accessed, as shown in Figure 1 3. Run in PowerShell: go run web-servers.go, visit againhttp://localhost:4000/When, the output: hello!, as shown in Figure 2
-
Post Views: 13 1. Check the Go file: exercise-maps.go, the code is as follows 2. Run the file, Go reports an error: exercise-maps.go:4:2: Cannot find package “code.google.com/p/go-tour/wc” in any of: C:\Go\src\code.google.com\p\go-tour\wc (from $goroot) C:\Users\Administrator\Go\src\code.google.com\p\go-tour\wc (from $gopath), as shown in Figure 1 3. Open the URL of Go Tour on GitHub:https://github.com/golang/tour, after turning on the blue light connection, install the go…
-
Post Views: 14 1. In the text mode of the editor, there are code snippets that start and end with go, as shown in Figure 1 2. Browse on the web page and find that it is not effective, it is still original text information, as shown in Figure 2 3. Get a list of valid tags (under “alias”) and…