Using JSON in Postgres by example.
- Download and install: Docker Toolbox
- Open Docker Quickstart Terminal
- Start a new postgres container:
docker run --name my-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
Using JSON in Postgres by example.
docker run --name my-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
package utils | |
import ( | |
"runtime" | |
"github.com/Sirupsen/logrus" | |
) | |
// DecorateRuntimeContext appends line, file and function context to the logger | |
func DecorateRuntimeContext(logger *logrus.Entry) *logrus.Entry { |
roomrate | |
======== | |
{ | |
'city': 'Berlin', | |
'hotel': 'Hilton', | |
'date': '2013-08-09' | |
'room_type': 'single', | |
'occupancy': 2, | |
'avail_count': 13, | |
'booked_count': 4, |
package main | |
import ( | |
"flag" | |
"log" | |
"os" | |
"syscall" | |
"unsafe" | |
"path/filepath" | |
"bufio" |
include $(GOROOT)/src/Make.inc | |
GOFMT=gofmt -spaces=true -tabindent=false -tabwidth=4 | |
all: | |
$(GC) jsontest.go | |
$(LD) -o jsontest.out jsontest.$O | |
format: | |
$(GOFMT) -w jsontest.go |