From d2143e44773ba5d441b464a1e92b0b964f937355 Mon Sep 17 00:00:00 2001 From: Kuisong Tong Date: Mon, 13 Mar 2023 21:41:17 -0700 Subject: [PATCH] release v0.1.0 (#26) --- .golangci.yml | 2 +- CHANGELOG.md | 4 ++++ README.md | 22 ++++++++++++++++++++++ config.go | 4 ++-- go.mod | 2 +- provider/file/testdata/config.json | 2 +- 6 files changed, 31 insertions(+), 5 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 4731bcc9..f7f80eef 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -133,7 +133,7 @@ issues: exclude-rules: - text: 'shadow: declaration of "(err|ctx)" shadows declaration at' linters: - - govet + - govet - path: _test\.go linters: - funlen diff --git a/CHANGELOG.md b/CHANGELOG.md index cd6a9fcb..a90ff3e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,3 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] + +## [v0.1.0] - 3/12/2023 + +Initial alpha release. diff --git a/README.md b/README.md index 5f31a43d..b5f0daa1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # A minimal configuration API for Go [![Go Reference](https://pkg.go.dev/badge/github.com/ktong/konf.svg)](https://pkg.go.dev/github.com/ktong/konf) +[![Build](https://github.com/ktong/konf/actions/workflows/test.yml/badge.svg)](https://github.com/ktong/konf/actions/workflows/test.yml) +[![Coverage](https://codecov.io/gh/ktong/konf/branch/main/graph/badge.svg)](https://codecov.io/gh/ktong/konf) konf offers an(other) opinion on how Go programs can read configuration without becoming coupled to a particular configuration source. It contains two APIs with two @@ -87,3 +89,23 @@ There are providers for the following configuration sources: - `file` loads configuration from a file. - `flag` loads configuration from flags. - `pflag` loads configuration from [spf13/pflag](https://github.com/spf13/pflag). + +## Compatibility + +konf ensures compatibility with the current supported versions of +the [Go language](https://golang.org/doc/devel/release#policy): + +> Each major Go release is supported until there are two newer major releases. +> For example, Go 1.5 was supported until the Go 1.7 release, +> and Go 1.6 was supported until the Go 1.8 release. + +For versions of Go that are no longer supported upstream, konf will stop ensuring +compatibility with these versions in the following manner: + +- A minor release of konf will be made to add support for the new + supported release of Go. +- The following minor release of konf will remove compatibility + testing for the oldest (now archived upstream) version of Go. This, and + future, releases of konf may include features only supported by + the currently supported versions of Go. + diff --git a/config.go b/config.go index b5f040bb..f2a4afa9 100644 --- a/config.go +++ b/config.go @@ -36,8 +36,8 @@ func New(opts ...Option) (*Config, error) { continue } - if configer, ok := loader.(ConfigAware); ok { - configer.WithConfig(config) + if configAware, ok := loader.(ConfigAware); ok { + configAware.WithConfig(config) } values, err := loader.Load() diff --git a/go.mod b/go.mod index 62cafd84..cbf698cc 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/ktong/konf -go 1.19 +go 1.18 require ( github.com/fsnotify/fsnotify v1.6.0 diff --git a/provider/file/testdata/config.json b/provider/file/testdata/config.json index 560eadc2..f9a2909e 100644 --- a/provider/file/testdata/config.json +++ b/provider/file/testdata/config.json @@ -1,5 +1,5 @@ { - "p" : { + "p": { "k": "v" } }