For Go projects that consist of only one package, the following Travis configuration is enough to get started with coveralls.io. You may want to encrypt your $COVERALLS_TOKEN via Travis encryption keys though.
language: go
go:
- 1.3.1| package main | |
| import "fmt" | |
| import "sort" | |
| func main() { | |
| m := map[string]int{ | |
| "One": 1, | |
| "Two": 2, | |
| "Three": 3, |
| package main | |
| import ( | |
| "fmt" | |
| "time" | |
| ) | |
| func mainLoop() { | |
| fmt.Println("starting main loop, this will die after dividing by 0") | |
| i := 0 |
| package main | |
| import ( | |
| "log" | |
| "net/smtp" | |
| ) | |
| func main() { | |
| send("hello there") | |
| } |
| /* | |
| This is a go program to download pictures from a tumblr blog page. | |
| To Build: | |
| go build -o tumblr-download tumblr-download.go | |
| To Run: | |
| # download the photos on the first page of tumblr blog |
| import ( | |
| "crypto/md5" | |
| "encoding/hex" | |
| ) | |
| func GetMD5Hash(text string) string { | |
| hasher := md5.New() | |
| hasher.Write([]byte(text)) | |
| return hex.EncodeToString(hasher.Sum(nil)) | |
| } |
For Go projects that consist of only one package, the following Travis configuration is enough to get started with coveralls.io. You may want to encrypt your $COVERALLS_TOKEN via Travis encryption keys though.
language: go
go:
- 1.3.1| # Feel free to change this path of course (and keys_zone value as well, but also change the usage of it below). | |
| proxy_cache_path /var/www/cache/resized levels=1:2 keys_zone=resizedimages:10m max_size=1G; | |
| # Gzip was on in another conf file of mine...You may need to uncomment the next line. | |
| #gzip on; | |
| gzip_disable msie6; | |
| gzip_static on; | |
| gzip_comp_level 4; | |
| gzip_proxied any; | |
| # Again, be careful that you aren't overwriting some other setting from another config's http {} section. |
| GOPATH=$(shell pwd)/vendor:$(shell pwd) | |
| GOBIN=$(shell pwd)/bin | |
| GOFILES=$(wildcard *.go) | |
| GONAME=$(shell basename "$(PWD)") | |
| PID=/tmp/go-$(GONAME).pid | |
| build: | |
| @echo "Building $(GOFILES) to ./bin" | |
| @GOPATH=$(GOPATH) GOBIN=$(GOBIN) go build -o bin/$(GONAME) $(GOFILES) |
| func downloadAndSaveAudioFile(_ audioFile: String, completion: @escaping (String) -> Void) { | |
| //Create directory if not present | |
| let paths = NSSearchPathForDirectoriesInDomains(FileManager.SearchPathDirectory.libraryDirectory, FileManager.SearchPathDomainMask.userDomainMask, true) | |
| let documentDirectory = paths.first! as NSString | |
| let soundDirPathString = documentDirectory.appendingPathComponent("Sounds") | |
| do { | |
| try FileManager.default.createDirectory(atPath: soundDirPathString, withIntermediateDirectories: true, attributes:nil) | |
| print("directory created at \(soundDirPathString)") |