Input outside of a unit

This commit is contained in:
2014-08-30 20:53:41 +07:00
parent 509f281f72
commit 6c8fd03a69
4 changed files with 14 additions and 28 deletions
-17
View File
@@ -1,17 +0,0 @@
package input
import (
"flag"
"code.google.com/p/go.net/context"
)
func FromFlag(ctx context.Context) context.Context {
var num int
flag.IntVar(&num, "num", 0, "Pass this number")
flag.Parse()
ctx = context.WithValue(ctx, "num", num)
return ctx
}