Last active
August 29, 2015 14:02
-
-
Save vlebedev/fe33288b062365219ce4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "flag" | |
// Define flags | |
var ( | |
httpPort = flag.Int("http_port", 4762, "HTTP localhost admin port.") | |
configDir = flag.String("config_dir", "/etc/runsit", "Directory containing per-task *.json config files.") | |
) | |
// Use them | |
func main() { | |
flag.Parse() | |
ln, err := net.Listen("tcp", fmt.Sprintf("%s:%d", listenAddr, *httpPort)) | |
if err != nil { | |
logger.Printf("Error listening on port %d: %v", *httpPort, err) | |
os.Exit(1) | |
return | |
} | |
logger.Printf("Listening on port %d", *httpPort) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment