Skip to content

Instantly share code, notes, and snippets.

// pkg/config/config.go
package config
import (
"flag"
"fmt"
"os"
)
// pkg/db/db.go
package db
import (
"database/sql"
_ "github.com/lib/pq"
)
// pkg/application/application.go
package application
import (
"github.com/boilerplate/pkg/config"
"github.com/boilerplate/pkg/db"
)
type Application struct {
// pkg/exithandler/exithandler.go
package exithandler
import (
"log"
"os"
"os/signal"
"syscall"
)
#!/bin/bash
# this script makes sure we have test db created for us
# when docker-compose is run
set -e
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
DROP DATABASE IF EXISTS boilerplatetest;
CREATE DATABASE boilerplatetest;
EOSQL
# Start from golang v1.13.4 base image to have access to go modules
FROM golang:1.13.4
# create a working directory
WORKDIR /app
# Fetch dependencies on separate layer as they are less likely to
# change on every build and will therefore be cached for speeding
# up the next build
COPY ./go.mod ./go.sum ./
cd $GOPATH/src/github.com/boilerplate && \
go mod init github.com/boilerplate
package temp
import (
"math"
)
var availabletemps = []int{
3,
-20,
1,

Keybase proof

I hereby claim:

  • I am daniel1984 on github.
  • I am dansan (https://keybase.io/dansan) on keybase.
  • I have a public key ASBfVgIi_uUNtc-GZMbzQqTkKsRGkQmoKgqnywSxe3bd4Qo To claim this, I am signing this object:
{
  "body": {
    "key": {

Keybase proof

I hereby claim:

  • I am daniel1984 on github.
  • I am dansan (https://keybase.io/dansan) on keybase.
  • I have a public key ASDdrGrFssDs3WrO3wYOwSAeWllrwKdPQUUNBcuo-iWWVwo

To claim this, I am signing this object: