Skip to content
Permalink
Browse files

CI, coverage and stuff

  • Loading branch information...
Depado committed Nov 8, 2017
1 parent 447cde2 commit b274ca0c968d96b1d0b1ceb11d5cdc683b5bf30c
Showing with 138 additions and 1 deletion.
  1. +21 −0 .drone.yml
  2. +1 −1 .gitignore
  3. +57 −0 Gopkg.lock
  4. +30 −0 Gopkg.toml
  5. +29 −0 README.md
@@ -0,0 +1,21 @@
workspace:
base: /go
path: src/github.com/Dpado/conftags/

pipeline:
# Dep and vendoring
prerequisites:
image: golang:1.9
commands:
- go get -u github.com/golang/dep/cmd/dep
- dep ensure

# Test
test:
image: golang:1.9
commands:
- go test -race -coverprofile=coverage.txt -covermode=atomic

codecov:
image: robertstettner/drone-codecov
secrets: [ codecov_token ]
@@ -13,4 +13,4 @@

# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
.glide/

vendor/

Some generated files are not rendered by default. Learn more.

@@ -0,0 +1,30 @@

# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"


[[constraint]]
branch = "master"
name = "github.com/alecthomas/assert"

[[constraint]]
name = "github.com/sirupsen/logrus"
version = "1.0.3"
@@ -1,2 +1,31 @@
# conftags

![Go Version](https://img.shields.io/badge/go-1.8-brightgreen.svg)
![Go Version](https://img.shields.io/badge/go-1.9-brightgreen.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/Depado/conftags)](https://goreportcard.com/report/github.com/Depado/conftags)
[![Build Status](https://drone.depado.eu/api/badges/Depado/conftags/status.svg)](https://drone.depado.eu/Depado/conftags)
[![codecov](https://codecov.io/gh/Depado/conftags/branch/master/graph/badge.svg)](https://codecov.io/gh/Depado/conftags)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Depado/bfchroma/blob/master/LICENSE)

Similar to [github.com/caarlos0/env](https://github.com/caarlos0/env) but with
default decoupled from environment. It also doesn't support slices.

This library intends to work as the last step in the filling of a configuration
struct. Assuming that environment variables are the highest priority
configuration values, you could first parse a configuration file, and then parse
this struct with this library. The last resort is the default which will fill
the struct field only if it has the zero value for its own type.

## Usage

```go
type MyConf struct {
Int int `env:"INT" default:"10"`
String string `env:"STRING"`
Duration time.Duration `env:"DURATION" default:"1h"`
}
func (ms *MyConf) Parse() error {
return conftags.Parse(ms)
}
```

0 comments on commit b274ca0

Please sign in to comment.
You can’t perform that action at this time.