A running example of the code from:
- http://marcio.io/2015/07/handling-1-million-requests-per-minute-with-golang
- http://nesv.github.io/golang/2014/02/25/worker-queues-in-go.html
Small refactorings made to original code:
| const VERSION: Option<&'static str> = option_env!("CARGO_PKG_VERSION"); | |
| fn main() { | |
| println!("Hello, world!"); | |
| println!("version: {}", VERSION.unwrap_or("dev")); | |
| } |
| use std::process::Command; | |
| const VERSION: Option<&'static str> = option_env!("CARGO_PKG_VERSION"); | |
| fn main() { | |
| println!("Hello, world!"); | |
| println!("version: {}", VERSION.unwrap_or("dev")); | |
| let output = Command::new("git") | |
| .args(&["rev-parse", "HEAD"]) |
| package main | |
| import ( | |
| "bytes" | |
| "encoding/base64" | |
| "encoding/json" | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "net/http" |
A running example of the code from:
Small refactorings made to original code: