diff --git a/.travis.yml b/.travis.yml index 65bf9f3..8abb1ed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,10 @@ go: go_import_path: aahframework.org/config.v0 +install: + - git config --global http.https://aahframework.org.followRedirects true + - go get -t -v ./... + script: - bash <(curl -s https://aahframework.org/go-test) diff --git a/README.md b/README.md index 6edf55b..0b62f4c 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # config - aah framework [![Build Status](https://travis-ci.org/go-aah/config.svg?branch=master)](https://travis-ci.org/go-aah/config) [![codecov](https://codecov.io/gh/go-aah/config/branch/master/graph/badge.svg)](https://codecov.io/gh/go-aah/config/branch/master) [![Go Report Card](https://goreportcard.com/badge/aahframework.org/config.v0)](https://goreportcard.com/report/aahframework.org/config.v0) -[![Version](https://img.shields.io/badge/version-0.4.1-blue.svg)](https://github.com/go-aah/config/releases/latest) [![GoDoc](https://godoc.org/aahframework.org/config.v0?status.svg)](https://godoc.org/aahframework.org/config.v0) [![License](https://img.shields.io/github/license/go-aah/config.svg)](LICENSE) +[![Version](https://img.shields.io/badge/version-0.4.2-blue.svg)](https://github.com/go-aah/config/releases/latest) [![GoDoc](https://godoc.org/aahframework.org/config.v0?status.svg)](https://godoc.org/aahframework.org/config.v0) [![License](https://img.shields.io/github/license/go-aah/config.svg)](LICENSE) [![Twitter](https://img.shields.io/badge/twitter-@aahframework-55acee.svg)](https://twitter.com/aahframework) -***v0.4.1 [released](https://github.com/go-aah/config/releases/latest) and tagged on Apr 23, 2017*** +***v0.4.2 [released](https://github.com/go-aah/config/releases/latest) and tagged on Jul 30, 2017*** `config` library is powerful and flexible for configuration purpose. It's thin layer around `forge` config syntax which is very similar to Typesafe HOCON syntax :satisfied:. aah framework and it's modules is powered with `aah/config` library. diff --git a/config.go b/config.go index 7bc32f0..95d5454 100644 --- a/config.go +++ b/config.go @@ -19,7 +19,7 @@ import ( ) // Version no. of aahframework.org/config library -var Version = "0.4.1" +var Version = "0.4.2" var errKeyNotFound = errors.New("config: not found") @@ -365,8 +365,8 @@ func (c *Config) Merge(source *Config) error { // IsExists returns true if given is exists in the config otherwise returns false func (c *Config) IsExists(key string) bool { - _, f := c.get(c.prepareKey(key)) - return f + _, found := c.Get(key) + return found } // ToJSON method returns the configuration values as JSON string. diff --git a/config_test.go b/config_test.go index 1ebfc24..fb7e5c6 100644 --- a/config_test.go +++ b/config_test.go @@ -348,7 +348,6 @@ func TestLoadFiles(t *testing.T) { assert.Equal(t, float32(1000.5), cfg.Float32Default("subsection.sub_float", 0.0)) assert.Equal(t, float32(222.2), cfg.Float32Default("float32", 0.0)) assert.Equal(t, true, cfg.BoolDefault("falsevalue", false)) - // assert.Equal(t, false, cfg.BoolDefault("truevalue", true)) // TODO check why result is different // fail cases _, err = LoadFiles(join(testdataPath, "not_exists.cfg"))