A simple demo of boltdb.
Compare prefix and range scans with the levelup approach described in the Rod Vagg's article, LevelDB and Node: Getting Up and Running.
See also the intro articles/talks by ...
@echo off | |
goto START | |
------------------------------------------------------- | |
go-path.bat | |
set the GOPATH to current directory | |
Created Sat May 3 20:00:00 2014 |
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func gcd(a, b int) int { | |
for b != 0 { | |
rem := math.Mod(float64(a), float64(b)) |
A simple demo of boltdb.
Compare prefix and range scans with the levelup approach described in the Rod Vagg's article, LevelDB and Node: Getting Up and Running.
See also the intro articles/talks by ...
package lpcwstr | |
// #include <windows.h> | |
// #include <wchar.h> | |
// #include <WinNT.h> | |
import "C" | |
import ( | |
"unicode/utf16" | |
"unsafe" |
package main | |
import ( | |
"log" | |
"net/http" | |
"net/http/httputil" | |
) | |
func main() { | |
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { |
// Copyright 2011 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. | |
// HTTP reverse proxy handler | |
package goengine | |
import ( | |
"io" |
package main | |
import ( | |
"strings" | |
) | |
func main() { | |
strings.HasSuffix("foobar", "bar") // true | |
} |
OUT := binariy-name | |
PKG := gitlab.com/group/project | |
VERSION := $(shell git describe --always --long --dirty) | |
PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/) | |
GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/) | |
all: run | |
server: | |
go build -i -v -o ${OUT} -ldflags="-X main.version=${VERSION}" ${PKG} |
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
) | |
func dumpMap(space string, m map[string]interface{}) { | |
for k, v := range m { | |
if mv, ok := v.(map[string]interface{}); ok { |