View main.go
package main
import (
_ "fmt"
_ "net"
_ "github.com/samuel/go-zookeeper"
)
func main() {}
View main.go
// Server for HTTPS protocol. Redirects to canonical hosts, reverse proxies requests to internal backing servers.
package main
import (
"crypto/tls"
"flag"
"log"
"net/http"
"net/http/httputil"
"time"
View main.go
// Server for HTTP protocol. Redirects all requests to HTTPS.
package main
import (
"flag"
"log"
"net/http"
)
var (
View Default (OSX).sublime-keymap
[
// ... (existing content)
// Add folder that contains current file to sidebar.
{ "keys": ["f3"], "command": "add_to_project" },
// ...
]
View Default (OSX).sublime-keymap
[
// ... (existing content)
// Find selected text, even if it spans multiple lines (unlike "find_selected_text").
{ "keys": ["super+f"], "command": "run_multiple_commands", "args":
{ "commands":
[
// Only execute slurp if there's selected text.
{"command": "slurp_find_string", "context": "window", "condition": "selected_text"},
{"command": "show_panel", "args": {"panel": "find", "reverse": false}, "context": "window"}
View gist:86949a392dcdac1f94cf

Compiling a Go project.

Conception-go $ go build
Conception-go $ 

Compiling a C++ project.

View gist:3f58c38dc262058c3e04

An example where var err error; something, err = foo() is nicer than something, err := foo().

This is a less common situation.

    fd := os.Stdout
    if *output != "" {
        var err error
        fd, err = os.Create(*output)
        if err != nil {
View gist:5f9e93c38f6b75421060
<ul>
{{/* So simple... */}}
{{range .Commits}}<li>{{.Commit.Message}}</li>
{{end}}
{{/* Is this really the shortest/best way to to do reverse range? */}}
{{range $i, $v := .Commits}}<li>{{(index $.Commits (revIndex $i (len $.Commits))).Commit.Message}}</li>
{{end}}
</ul>
View gist:81f1e59bb0db7febff94

go get

  • Benchmark three ways to get/update (from scratch) the same 17 Go packages contained in a single git repo.
go get -d -u github.com/shurcooL/go/cmd/gocd
go get -d -u github.com/shurcooL/go/cmd/table
go get -d -u github.com/shurcooL/go/exp/11
go get -d -u github.com/shurcooL/go/exp/12