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
" Copyright 2013 The Go Authors. All rights reserved. | |
" Use of this source code is governed by a BSD-style | |
" license that can be found in the LICENSE file. | |
" | |
" compiler/go.vim: Vim compiler file for Go. | |
if exists("current_compiler") | |
finish | |
endif | |
let current_compiler = "go" |
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
"this produces an output like: | |
" /path/file1.txt | |
" /path/file2.txt | |
" /path/file3.txt | |
function! GoFiles() | |
let out=system("go list -f $'{{range $f := .GoFiles}}{{$.Dir}}/{{$f}}\n{{end}}'") | |
echo out | |
endfunction |
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
" check for ctags folder, if not exist extract our ctags binary | |
if !isdirectory(expand("$HOME/.vim/binary/ctags/")) | |
let ctags_bottle_dir = expand("$HOME/.vim/binary/") | |
let ctags_bottle_file = expand("$HOME/.vim/binary/ctags-5.8.mountain_lion.bottle.tar.gz") | |
execute "cd ".ctags_bottle_dir | |
execute "!tar xfv ".ctags_bottle_file | |
endif |
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
package main | |
import ( | |
"container/ring" | |
"fmt" | |
"time" | |
) | |
func main() { | |
coffee := []string{"kenya", "guatemala", "ethiopia"} |
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
package main | |
import ( | |
"fmt" | |
"github.com/caglar10ur/lxc" | |
) | |
func main() { | |
// first create and start | |
l := lxc.NewContainer("testing") |
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
// A very simple example about how to use concurrent-safe SETs (using string as keys) in GO | |
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
type Set struct { | |
m map[string]bool |
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
package main | |
import ( | |
zmq "github.com/pebbe/zmq3" | |
) | |
func main() { | |
responder, _ := zmq.NewSocket(zmq.REP) | |
defer responder.Close() | |
responder.SetIdentity("1123581321") //key to be used |
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
package main | |
import ( | |
"fmt" | |
zmq "github.com/pebbe/zmq3" | |
"log" | |
) | |
func main() { | |
requester, _ := zmq.NewSocket(zmq.REQ) |
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
package main | |
import ( | |
"fmt" | |
zmq "github.com/pebbe/zmq3" | |
"log" | |
) | |
func main() { | |
var err error |
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
{ | |
"_id" : ObjectId("51b8582110b7fc5960000001"), | |
"docname" : "foo", | |
"entries" : { | |
"example-123" : { | |
"enabled" : true, | |
"mode" : "bar", | |
"entryname" : "example-123" | |
} | |
} |