Skip to content
Advertisement

Tag: go

Cross-compilation of cgo (for darwin) fails

I am fairly new to go and even Linux in general. I have built an app in a Linux environment which makes use of a gtk lib based on cgo (https://github.com/mattn/go-gtk/). The application builds fine in its native environment (linux 64bit) but when I try to compile for darwin 64bit I get the following result: The command line I use

Getting a pipe status in Go

I’m unable to get a pipe state in Go (1.5). While writing on a mkfifo created pipe, I try to get the state of this output pipe: using the Write return status EPIPE using the Write return status EPIPE and signal.Ignore on SIGPIPE (just in case) using signal.Notify on SIGPIPE I can see that: EPIPE is never returned when I

Golang UDP Server only recieving locally sent packets

I’ve written a UDP Server in Go(listens on port 666), and it seems to be only receiving packets that were sent locally. To confirm traffic, I have been using: My(abbreviated) server code: If, from the machine the server is running on, I use: then the server receives that packet, and prints the message(and tcpdump shows no output). However, if I

Is it possible to break out of a restricted (custom) shell?

Not sure if this is the right place to ask. Say I write a shell that takes stdin input, filters this input so let’s say only certain commands like ls (list contents of binary directory and subdirectory) update (git clone) build (go build) test (go test) start (systemctl start this.service only) stop (systemctl stop this.service only) running (is the binary

Start a process in Go and detach from it

I need to start a new process in Go with the following requirements: The starting process should run even after the Go process is terminated I need to be able to set the Unix user/group that’s running it I need to be able to set the environment variables inherited I need control over std in/out/err Here is an attempt: This

go install always uses GOROOT/bin instead of GOPATH

I’m having annoying issue with go install command. Every time I try to run it within the src directory of my GOPATH the resulted file is getting created in GOROOT/bin directory for some reason. I verified my environmental variables in .bashrc and also run ‘go env’ (see below) and couldn’t find any issues: .bashrc go env This post has a

Trying to launch an external editor from within a Go program

I am trying to figure out how to launch an external editor from within a Go program, wait for the user to close the editor, and then continue execution of the program. Based on this SO answer, I currently have this code: When I run the program, I get this: I have also tried using exec.Run() instead of exec.Start(), but

Advertisement