From 246e5b2013b2b98bac8be8cacf27e7a18a91aeee Mon Sep 17 00:00:00 2001 From: Fenimore Love Date: Tue, 13 Feb 2018 21:02:53 -0500 Subject: [PATCH] Add ship script --- alio.go | 46 +++++++++++++++++++++------------------------- ship.sh | 3 +++ 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/alio.go b/alio.go index 69422bf..6f1252a 100644 --- a/alio.go +++ b/alio.go @@ -9,8 +9,6 @@ import ( "os" "path" "path/filepath" - "runtime" - "runtime/pprof" "strings" "sync" "time" @@ -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 { diff --git a/ship.sh b/ship.sh index 7a8e9d7..64cf646 100644 --- a/ship.sh +++ b/ship.sh @@ -1 +1,4 @@ +#!/bin/bash + +echo "Moving alio to bin at $GOPATH/bin" go build alio.go && mv alio $GOPATH/bin/