Questions tagged [golang]
Installing and using the Go language and tools associated with it (like the go command). Programming in Go itself is off-topic.
26 questions
1
vote
2
answers
189
views
Why does the kill command not work for SIGTSTP, but works for some other signals (SIGSTOP/SIGINT etc.)?
I have the following two simple programs.
Parent:
package main
import (
"fmt"
"syscall"
)
func main() {
attr := &syscall.ProcAttr{
Files: []uintptr{0, 1, ...
1
vote
0
answers
92
views
Command works when path is entered manually, but not when $PATH is used
I installed Golang into a custom folder under $HOME called .go/exec. After the installation, it put the binary under $HOME/.go/exec/go.
So I updated $PATH to contain this directory: $HOME/.go/exec:$...
1
vote
1
answer
89
views
Pi Zero Cross Compilation Floating Point Specification
I am trying to cross compile a go project (syzkaller) to target a Pi Zero so it can emulate usb devices. The problem is that I have been unable to find information regarding how to specify the proper ...
0
votes
1
answer
267
views
envoy proxy running on localhost works fine from curl, but times out from golang "hey" tool
I'm stepping through some Envoy tutorials (probably doesn't matter if you don't know what that is). I'm doing this on my Ubuntu VM (Windows 11 host) and I'm behind a corporate firewall.
We run a ...
3
votes
0
answers
846
views
named pipe (mkfifo): how to detect on macos that the reading end (consumer) has disconnected, without the consumer writing to the write end?
Note: this is about the producer detecting the consumer disconnecting, not the consumer detecting that the producer disconnected (aka EOF). The producer might not write any data for long periods, but ...
-2
votes
2
answers
2k
views
How to unistalled Go tools in Linux using command line?
I installed cf using
go get github.com/xalanq/cf-tool
cd $GOPATH/src/github.com/xalanq/cf-tool
go build -ldflags "-s -w" cf.go
cf --version
output: Codeforces Tool (cf) v1.0.0
I tried to ...
0
votes
0
answers
257
views
Is it possible to change the file permission of itself
I created a binary file with Go Language. The owner of the file will be "userA" and the execution permission is set as "userA". The above configurations is enabled using the ...
0
votes
1
answer
640
views
Not able to install golang migrate on ubuntu 22.04
curl -L https://packagecloud.io/golang-migrate/migrate/gpgkey | apt-key add -
% Total % Received % Xferd Average Speed Time Time Time Current
Dload ...
0
votes
1
answer
675
views
How to fix error Code bin root/go/bin not a valid identifier?
Trying to install chainlink on my laptop I had to install go. Doing so i think i have done something wrong and now i having error message each time I open ubuntu terminal which contents the following:
...
0
votes
1
answer
139
views
How to compile Go programs in AltLinux?
I'm trying to install aptly from source (I'm using Simply Linux 9), I followed their instructions under the BINARY RELEASES section:
$ git clone https://github.com/aptly-dev/aptly`
But I'm getting ...
1
vote
1
answer
1k
views
gmail sendgmail configuration for git send-email
From May 30, 2022:
Google no longer supports the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password.
This is a problem for ...
0
votes
0
answers
673
views
What's the best way to upgrade Go to 1.18 on Alma Linux?
I need to upgrade the version of Go on my Alma Linux 8 box from the installed version 1.16 to the latest 1.18.
There are several tutorials on how to install, but I haven’t found any for upgrade ...
1
vote
0
answers
939
views
Unable to install Bazel using Bazelisk
I want to install Bazel on linux 20.04 version. I have already installed go.
I am trying to use the command go install github.com/bazelbuild/bazelisk@latest mentioned in here.
Somehow I am unable to ...
0
votes
0
answers
620
views
Ubuntu systemd using 100% CPU when running manually with sudo only uses 20%
I wrote a program in Golang (it is compiled) and ran it using systemd as it needs to run long-term, auto reboot and run on startup, but it's pinning the cpu at 100%. Comparatively when running using ...
0
votes
0
answers
155
views
Is there a darwin (arm64) equivalent of `O_PATH` for open?
I want to get the file descriptor without opening the file which can be attained by using the O_PATH flag on linux. (ref)
This flag doesn't seem to be there on darwin.
Context
I'm trying to use open ...
1
vote
0
answers
193
views
How to animate progress without overwriting other output?
Let's say I'm writing a program in Go that runs for a period of time while using ANSI control codes to animate a progress indicator line. For example,
outer:
for {
select {
case &...
1
vote
0
answers
861
views
--enable-languages unrecognized option for configure
I am trying to do a build of gcc11 (on RHEL 7.6 which comes with 4.8.5 and no root access). When I run the following:
./configure --prefix=$HOME/gnu --enable-languages=c,c++
I get the response
...
2
votes
1
answer
3k
views
Crosscompile go(lang) app with docker for alpine linux (musl) aarch64 with native libs so CGO enabled
Background
I'm writing an open-source GTK go app subsonic API client which:
targets on first place mobile friendly Linux like postmarketOS (alpine linux), Mobian (debian)
in future will be also ...
0
votes
0
answers
1k
views
How to get hardware info (especially GPU) in order to use Golang on Linux
I need to collect all GPUs' info of a Linux server (such as VRAM, clock speed, usage, model name, etc., ...) in order to use Go (AKA Golang).
I tried hwinfo and lspci, it just shows limited ...
0
votes
1
answer
210
views
How to set environmental in for by using os.Getenv() [closed]
Does anyone know how to set the environmental variable in Golang by using :
os.Getenv()
1
vote
1
answer
588
views
go command not working if I switch to super user in zsh shell
go command not working if I switch to super user in zsh shell ..i even updated the zshrc file ...anyone who knows solution to problem please explain in detail..I'm new to linux
-2
votes
1
answer
2k
views
I tried to install Golang in Kali Linux and it's showing the following error
Once go-lang is installed, if I type go version and press enter in the same terminal which I used to install go-lang, it works and it shows me the go version. If I open a new terminal and enter the ...
0
votes
1
answer
3k
views
couldn't import golang modules
I have a problem with importing a module github.com/lib/pq in GoLang. I'm using Garuda Linux and I think Garuda is setting go environments differently than windows or Ubuntu.
I installed using pacman, ...
2
votes
1
answer
1k
views
Rename and add to $PATH
I know that I can add a path to the $PATH on the bash terminal with the command PATH=$PATH:foo .
I also know I can create an alias for the bash with the command alias a=b
But only know I noticed that ...
3
votes
2
answers
1k
views
How to run `go run` against inline code
I have this mini bash script
#!/usr/bin/env bash
go run <(cat <<EOF
package main
import "log"
func main(){
log.Println("here 123")
}
EOF
)
go run takes a file path argument, often times ...
4
votes
1
answer
12k
views
How to properly set Environment variables (golang on Manjaro)
I have a problem with my go installation. I'm using Manjaro and I think it is related to this as Manjaro seems to handle the go env differently then suggestest by ubuntu and windows.
I have go ...