I have Ubuntu 14.4.03. The default golang version which came with it was 1.2.1. I would like to update golang to 1.4 or higher.
After searching I found the way to do this would be to first delete current go installation and then re-install the new version.
I found the following go installation files in the following directory:
/usr/share/go
/usr/share/go/src/cmd/go
/usr/share/go/src/pkg/go
/usr/lib/go
/ur/lib/go/pkg/linux_amd64/go
/ur/lib/go/pkg/linux_amd64_race/go
/usr/bin/go
Run Code Online (Sandbox Code Playgroud)
Which directory contains what? Which ones should I delete? What should be the location of …
这不是一个编程问题。
我有一台运行 Ubuntu 的机器,我在上面安装了 Golang。它工作正常......我什至运行了一些程序,但是“go1.11.2.linux-amd64.tar.gz”文件在我的主目录中,所以我认为可以将它移动到下载目录中。移动它后,我无法使用任何 Go 命令,并且找不到命令“go”。我尝试将文件移回主目录,但仍然遇到相同的错误。
有人可以向我解释这是怎么回事吗?谢谢!!
richie@richie-ThinkPad-T430:~$ go version
Command 'go' not found, but can be installed with:
sudo snap install go # version 1.11.2, or
sudo apt install golang-go
sudo apt install gccgo-go
See 'snap info go' for additional versions.
Run Code Online (Sandbox Code Playgroud)
我用来安装 Go 的命令:
wget https://dl.google.com/go/go1.11.2.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.11.2.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
source ~/.profile
Run Code Online (Sandbox Code Playgroud) 我正在尝试按照这些说明安装 Drive,但我无法Go正常工作。
我不断收到错误:
go tool: no such tool "6g"
当我尝试使用go get [url]. 尝试运行 hello world 脚本(检查 Go 是否已正确安装)时,我也会收到此错误。
我已经尝试安装这篇文章中推荐的各个程序(golang-go.tools gccgo-go) 中推荐的关于修复此错误但问题仍然存在。
我怎样才能得到这个6g工具?
以下是结果go env:
GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/user/go"
GORACE=""
GOROOT="/usr/share/go"
GOTOOLDIR="/usr/share/go/pkg/tool/linux_amd64"
TERM="dumb"
CC="gcc"
GOGCCFLAGS="-g -O2 -fPIC -m64 -pthread"
CXX="g++"
CGO_ENABLED="1"
Run Code Online (Sandbox Code Playgroud) Gogland 昨天作为预览版发布。我是 Linux 新手,在使用 .desktop 文件为它制作启动器时遇到了问题。
我以前从未创建过 .desktop 文件,我正在运行 Ubuntu 14.04
所以,这就是我现在所拥有的。
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec= cd /opt/Gogland/bin && ./gogland.sh
Name=Gogland
Comment=comment here
Icon=icon /opt/Gogland/bin/gogland.png
Run Code Online (Sandbox Code Playgroud)
权限设置为可执行,它位于: ~/.local/share/applications
问题是我无法在重新启动后在应用程序启动器小部件中找到 gogland。要启动程序,我转到bin文件夹并执行gogland.sh
如何在 Ubuntu 中正确安装和配置 Go 语言。有很多软件包可供选择,但是我需要安装哪些软件包以及之后我需要配置什么才能使用任何 Go 软件包而不会出现“找不到软件包”错误或任何其他基本错误那样。
我安装了该golang软件包,但是否需要安装任何其他软件包或配置其他内容?
作为示例,尝试运行以下命令:
package main
import (
"http"
"log"
)
func HelloServer(w http.ResponseWriter, req *http.Request) {
w.Header().Set("Content-Type", "text/plain")
w.Header().Set("Connection", "keep-alive")
w.Write([]byte("hello, world!\n"))
}
func main() {
http.HandleFunc("/", HelloServer)
log.Println("Serving at http://127.0.0.1:8080/")
http.ListenAndServe(":8080", nil)
}
Run Code Online (Sandbox Code Playgroud) 我正在寻找将 golang 1.9 安装到运行 Ubuntu 16.04 的笔记本电脑中的正确方法。
非常感谢
我已经从突触安装了所有与 go 相关的东西,然后按照维基中的描述添加了 ppa:https : //wiki.ubuntu.com/Go 但我不能做“go get”例如
go get code.google.com/p/gorilla/mux
Run Code Online (Sandbox Code Playgroud)
说找不到 go 命令。
我应该如何安装这个“go”命令?
我目前正在开发一个用 Golang 编写的服务器端应用程序。我想将应用程序打包到 snap 包中。
我可以将应用程序的全局配置文件存储在何处,即使在升级后仍可保留?
一些示例代码会很好,谢谢!
golang ×10
programming ×2
.desktop ×1
14.04 ×1
16.04 ×1
ide ×1
launcher ×1
ppa ×1
qml ×1
snap ×1
ubuntu-sdk ×1
ubuntu-touch ×1
updates ×1