Skip to content

Commit

Permalink
Add ship script
Browse files Browse the repository at this point in the history
  • Loading branch information
fenimore committed Feb 14, 2018
1 parent 4882b22 commit 246e5b2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 25 deletions.
46 changes: 21 additions & 25 deletions alio.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
"os"
"path"
"path/filepath"
"runtime"
"runtime/pprof"
"strings"
"sync"
"time"
Expand Down Expand Up @@ -84,29 +82,27 @@ func main() {
}

flag.Parse()

if *cpuprofile != "" {
f, err := os.Create(*cpuprofile)
if err != nil {
log.Fatal("could not create CPU profile: ", err)
}
if err := pprof.StartCPUProfile(f); err != nil {
log.Fatal("could not start CPU profile: ", err)
}
defer pprof.StopCPUProfile()
}
if *memprofile != "" {
f, err := os.Create(*memprofile)
if err != nil {
log.Fatal("could not create memory profile: ", err)
}
runtime.GC() // get up-to-date statistics
if err := pprof.WriteHeapProfile(f); err != nil {
log.Fatal("could not write memory profile: ", err)
}
f.Close()
}

// if *cpuprofile != "" {
// f, err := os.Create(*cpuprofile)
// if err != nil {
// log.Fatal("could not create CPU profile: ", err)
// }
// if err := pprof.StartCPUProfile(f); err != nil {
// log.Fatal("could not start CPU profile: ", err)
// }
// defer pprof.StopCPUProfile()
// }
// if *memprofile != "" {
// f, err := os.Create(*memprofile)
// if err != nil {
// log.Fatal("could not create memory profile: ", err)
// }
// runtime.GC() // get up-to-date statistics
// if err := pprof.WriteHeapProfile(f); err != nil {
// log.Fatal("could not write memory profile: ", err)
// }
// f.Close()
// }
if *debug {
logfile, err := os.Create("debug.log")
if err == nil {
Expand Down
3 changes: 3 additions & 0 deletions ship.sh
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
#!/bin/bash

echo "Moving alio to bin at $GOPATH/bin"
go build alio.go && mv alio $GOPATH/bin/

0 comments on commit 246e5b2

Please sign in to comment.