Discover Packages
github.com/fernandezvara/kli
examples
conversions
command
Version:
v0.4.0
Opens a new window with list of versions in this module.
Published: Nov 30, 2026
License: MIT
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0 modules, 0 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
README
README
¶
kli Type Conversion TDD Test Suite
Tests all Get[T]() type conversions across all configuration sources.
Usage
cd examples/conversions
go run main.go
What It Tests
7 types x 4 sources = 28 test cases
Sources
DEFAULT - only default values, no env/flag/file
ENV - environment variables override defaults
FLAG - command-line flags override defaults
FILE - JSON config file override defaults
Types Covered
Category
Types
Basic
string, bool
Integers
int64
Floats
float64
Time
time.Duration
Slices
[]string, []int64
Source | Key | Expected Type | Returned Type | Value | OK
--------------------------------------------------------------------------------------------------------------
DEFAULT | TEST_STRING | string | string | default_string | OK
ENV | TEST_INT64 | int64 | int64 | 42 | OK
FLAG | TEST_INT64_SLICE | []int64 | []int64 | [1000 2000 3000] | OK
Exit Code
0 - all tests passed
1 - one or more tests failed
Expand ▾
Collapse ▴
Documentation
¶
cli Type Conversion TDD Test Suite
Tests all supported type conversions across all sources (DEFAULT, ENV, FLAG, FILE)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.