Issue How can I create a static Go application that runs on every Linux distribution? Is it enough just to compile Go statically as in: http://blog.hashbangbash.com/2014/04/linking-golang-statically/ Solution It will work on every Linux distro if you’ve compiled for GOOS==linux as
Continue readingTag: linux
offline document for go/golang
Issue Is there any Ubuntu go offline document package that I can install so that I can read the package docs for Go offline? I thought it would be golang-doc but it is actually not — there aren’t any Go
Continue readingGolang regex exact line in file
Issue I have a file with below content # Requires authentication with auth-user-pass auth-user-pass #auth-user-pass # auth-user-pass auth-user-passwd Is there any way to regex only match the second line with Golang? I have tried with following code but it return
Continue readingGo: /usr/local/go/bin does not exist on CentOS 7.9
Issue I’m on a CentOS 7.9 virtual machine and I’m trying to install Go following this procedure (rif. https://computingforgeeks.com/install-go-golang-on-centos-rhel-linux/) sudo yum -y install wget wget https://go.dev/dl/go1.19.3.src.tar.gz sha256sum go1.19.3.src.tar.gz sudo tar -C /usr/local -xzf go*.src.tar.gz Then I’ve added export PATH=$PATH:/usr/local/go/bin in
Continue readingWhat's the difference between C and Go when there are remains in stdin on programs exits
Issue main.c #include <stdio.h> int main() { int k; scanf("%d", &k); return 0; } main.go package main import "fmt" func main() { var n int fmt.Scan(&n) } root@82da6559c1c0:/code# go run main.go 123×123 root@82da6559c1c0:/code# 123 bash: 123: command not found root@82da6559c1c0:/code#
Continue readingWhat's the difference between C and Go when there are remains in stdin on programs exits
Issue main.c #include <stdio.h> int main() { int k; scanf("%d", &k); return 0; } main.go package main import "fmt" func main() { var n int fmt.Scan(&n) } root@82da6559c1c0:/code# go run main.go 123×123 root@82da6559c1c0:/code# 123 bash: 123: command not found root@82da6559c1c0:/code#
Continue readingWhat's the difference between C and Go when there are remains in stdin on programs exits
Issue main.c #include <stdio.h> int main() { int k; scanf("%d", &k); return 0; } main.go package main import "fmt" func main() { var n int fmt.Scan(&n) } root@82da6559c1c0:/code# go run main.go 123×123 root@82da6559c1c0:/code# 123 bash: 123: command not found root@82da6559c1c0:/code#
Continue readingWhat's the difference between C and Go when there are remains in stdin on programs exits
Issue main.c #include <stdio.h> int main() { int k; scanf("%d", &k); return 0; } main.go package main import "fmt" func main() { var n int fmt.Scan(&n) } root@82da6559c1c0:/code# go run main.go 123×123 root@82da6559c1c0:/code# 123 bash: 123: command not found root@82da6559c1c0:/code#
Continue readingWhat's the difference between C and Go when there are remains in stdin on programs exits
Issue main.c #include <stdio.h> int main() { int k; scanf("%d", &k); return 0; } main.go package main import "fmt" func main() { var n int fmt.Scan(&n) } root@82da6559c1c0:/code# go run main.go 123×123 root@82da6559c1c0:/code# 123 bash: 123: command not found root@82da6559c1c0:/code#
Continue readingWhat's the difference between C and Go when there are remains in stdin on programs exits
Issue main.c #include <stdio.h> int main() { int k; scanf("%d", &k); return 0; } main.go package main import "fmt" func main() { var n int fmt.Scan(&n) } root@82da6559c1c0:/code# go run main.go 123×123 root@82da6559c1c0:/code# 123 bash: 123: command not found root@82da6559c1c0:/code#
Continue reading