conversions

command
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2026 License: MIT Imports: 6 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.

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

Output Format

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

Documentation

Overview

cli Type Conversion TDD Test Suite Tests all supported type conversions across all sources (DEFAULT, ENV, FLAG, FILE)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL