Example of how to use stdout and stdin from other programs in golang
Requires go
go run parentprocess.go
| package main | |
| import "fmt" | |
| //Listener is a | |
| type Listener struct { | |
| ID int | |
| } | |
| //ListenerInterface is an |
| xattr -d com.apple.quarantine /path/to/app/myMacApp.app |
| package main | |
| import ( | |
| "bufio" | |
| "io/ioutil" | |
| "os/signal" | |
| //"syscall" | |
| "fmt" | |
| "log" | |
| "os" |
| func createTorClient() *http.Client { | |
| proxyURL, err := url.Parse("socks5://127.0.0.1:9150") | |
| if err != nil { | |
| log.Fatal(err) | |
| } | |
| dialer, err := proxy.FromURL(proxyURL, proxy.Direct) | |
| if err != nil { | |
| log.Fatal(err) | |
| } |
| package main | |
| import ( | |
| "flag" | |
| "fmt" | |
| "time" | |
| ) | |
| // Fake a long and difficult work. | |
| func DoWork() { |
| #!/bin/bash | |
| # Go build script that runs cloc, cpd, lint, vet, test and coverage for Jenkins | |
| # | |
| # Outside tools include: | |
| # gocov: go get github.com/axw/gocov | |
| # gocov-xml: go get github.com/t-yuki/gocov-xml | |
| # go2xunit: go get bitbucket.org/tebeka/go2xunit | |
| # jscpd: npm i jscpd -g | |
| # cloc: npm i cloc -g |
| package main | |
| import ( | |
| "bytes" | |
| "crypto/rsa" | |
| "fmt" | |
| "log" | |
| "strings" | |
| "golang.org/x/crypto/openpgp" |
| package main | |
| import ( | |
| "net/http" | |
| "log" | |
| "io" | |
| "bufio" | |
| "os" | |
| ) |
| package importpaths | |
| import ( | |
| "log" | |
| "os" | |
| "strconv" | |
| "strings" | |
| "go/ast" | |
| "go/parser" |