diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index d6e9a8ae..db2c4fde 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -15,7 +15,7 @@ body: - type: textarea attributes: label: Module version info - description: Output of `go list -m -u github.com/essentialkaos/ek/v12` command + description: Output of `go list -m -u github.com/essentialkaos/ek/v13` command render: shell validations: required: true diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml index 69c29567..3b0a3429 100644 --- a/.github/ISSUE_TEMPLATE/question.yml +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -22,7 +22,7 @@ body: - type: textarea attributes: label: Related module version info - description: Output of `go list -m -u github.com/essentialkaos/ek/v12` command + description: Output of `go list -m -u github.com/essentialkaos/ek/v13` command render: shell validations: required: true diff --git a/.scripts/fuzz-gen.sh b/.scripts/fuzz-gen.sh index 2ff531d2..652bd2ce 100755 --- a/.scripts/fuzz-gen.sh +++ b/.scripts/fuzz-gen.sh @@ -72,12 +72,12 @@ main() { if [[ "$src_func" == "Fuzz" ]] ; then showm " ${CL_GREY}∙ ${CL_BOLD}${src_package}${CL_NORM}… " output="${src_name}-fuzz.zip" - go-fuzz-build -o "$output" "github.com/essentialkaos/ek/v12/${src_path}" &> /dev/null + go-fuzz-build -o "$output" "github.com/essentialkaos/ek/v13/${src_path}" &> /dev/null else showm " ${CL_GREY}∙ ${CL_BOLD}${src_package}${CL_NORM} ${CL_GREY}($src_func)${CL_NORM}… " func_min=$(echo "$src_func" | sed 's/Fuzz//' | tr '[:upper:]' '[:lower:]') output="${src_name}-${func_min}-fuzz.zip" - go-fuzz-build -func "$src_func" -o "$output" "github.com/essentialkaos/ek/v12/${src_path}" &> /dev/null + go-fuzz-build -func "$src_func" -o "$output" "github.com/essentialkaos/ek/v13/${src_path}" &> /dev/null fi # shellcheck disable=SC2181 diff --git a/CHANGELOG.md b/CHANGELOG.md index d183f2d8..c6298d25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ ## Changelog +### [13.0.0](https://kaos.sh/ek/13.0.0) + +> [!CAUTION] +> In this release, we have changed the logic behind some knf validators (`Less`, `Greater`, `LenLess`, `LenGreater`) from negative to positive check. This means that if you have any of these validators, you need to swap them (`Less` → `Greater`, `Greater` → `Less`, `LenLess` → `LenGreater`, `LenGreater` → `LenLess`) to keep the logic of the validation. + +- `[knf/validators]` Changed logic from negative to positive check for `Less`, `Greater`, `LenLess`, and `LenGreater` validators. +- `[knf/validators]` Validator `LenNotEquals` renamed to `LenEquals` +- `[knf/validators]` Validator `NotPrefix` renamed to `NotPrefix` +- `[knf/validators]` Validator `HasSuffix` renamed to `HasSuffix` +- `[knf/validators]` Validator `Equals` renamed to `NotEquals` +- `[log]` Code refactoring + +--- + ### [12.130.0](https://kaos.sh/ek/12.130.0) - `[knf/validators]` Added validators `Set`, `SetToAny`, `SetToAnyIgnoreCase`, `LenLess`, `LenGreater`, and `LenNotEquals` diff --git a/README.md b/README.md index 332126cf..503728a6 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@

- - GoReportCard + Code Climate Maintainability Codebeat badge Codacy badge @@ -30,73 +29,73 @@ Currently we support Linux and macOS (_except some packages_). All packages have ### Sub-packages -- [`ansi`](https://kaos.sh/g/ek.v12/ansi) — Package provides methods for working with ANSI/VT100 control sequences -- [`cache`](https://kaos.sh/g/ek.v12/cache) — Package provides a simple in-memory key/value cache -- [`color`](https://kaos.sh/g/ek.v12/color) — Package provides methods for working with colors -- [`cron`](https://kaos.sh/g/ek.v12/cron) — Package provides methods for working with cron expressions -- [`csv`](https://kaos.sh/g/ek.v12/csv) — Package with simple CSV parser compatible with default Go parser -- [`easing`](https://kaos.sh/g/ek.v12/easing) — Package with easing functions (_Back, Bounce, Circ, Cubic, Elastic, Expo, Linear, Quad, Quint, Sine_) -- [`emoji`](https://kaos.sh/g/ek.v12/emoji) — Package provides methods for working with emojis -- [`env`](https://kaos.sh/g/ek.v12/env) — Package provides methods for working with environment variables -- [`errutil`](https://kaos.sh/g/ek.v12/errutil) — Package provides methods for working with errors -- [`events`](https://kaos.sh/g/ek.v12/events) — Package provides methods and structs for creating event-driven systems -- [`directio`](https://kaos.sh/g/ek.v12/directio) — Package provides methods for reading/writing files with direct io -- [`fmtc`](https://kaos.sh/g/ek.v12/fmtc) — Package provides methods similar to fmt for colored output ([_more info and examples_](fmtc/README.md)) -- [`fmtutil`](https://kaos.sh/g/ek.v12/fmtutil) — Package provides methods for output formatting -- [`fmtutil/barcode`](https://kaos.sh/g/ek.v12/fmtutil/barcode) — Package provides methods to generate colored representation of unique data -- [`fmtutil/panel`](https://kaos.sh/g/ek.v12/fmtutil/panel) — Package contains methods for rendering panels with text -- [`fmtutil/table`](https://kaos.sh/g/ek.v12/fmtutil/table) — Package contains methods and structs for rendering data in tabular format -- [`fsutil`](https://kaos.sh/g/ek.v12/fsutil) — Package provides methods for working with files on POSIX compatible systems (_BSD/Linux/macOS_) -- [`hash`](https://kaos.sh/g/ek.v12/hash) — Package hash contains different hash algorithms and utilities -- [`httputil`](https://kaos.sh/g/ek.v12/httputil) — Package provides methods for working with HTTP request/responses -- [`i18n`](https://kaos.sh/g/ek.v12/i18n) — Package provides methods and structs for internationalization -- [`initsystem`](https://kaos.sh/g/ek.v12/initsystem) — Package provides methods for working with different init systems (_sysv, upstart, systemd_) -- [`initsystem/sdnotify`](https://kaos.sh/g/ek.v12/initsystem/sdnotify) — Package provides methods methods for sending [notifications to systemd](https://www.freedesktop.org/software/systemd/man/latest/sd_notify.html#Well-known%20assignments) -- [`jsonutil`](https://kaos.sh/g/ek.v12/jsonutil) — Package provides methods for working with JSON data -- [`knf`](https://kaos.sh/g/ek.v12/knf) — Package provides methods for working with configuration files in [KNF format](https://kaos.sh/knf-spec) -- [`knf/united`](https://kaos.sh/g/ek.v12/knf/united) — Package provides united configuration (_knf + options + environment variables_) -- [`log`](https://kaos.sh/g/ek.v12/log) — Package with an improved logger -- [`lock`](https://kaos.sh/g/ek.v12/lock) — Package provides methods for working with lock files -- [`lscolors`](https://kaos.sh/g/ek.v12/lscolors) — Package provides methods for colorizing file names based on colors from dircolors -- [`mathutil`](https://kaos.sh/g/ek.v12/mathutil) — Package provides some additional math methods -- [`netutil`](https://kaos.sh/g/ek.v12/netutil) — Package provides methods for working with network -- [`options`](https://kaos.sh/g/ek.v12/options) — Package provides methods for working with command-line options -- [`pager`](https://kaos.sh/g/ek.v12/pager) — Package provides methods for pager setup (_like_ `more`/`less`) -- [`passthru`](https://kaos.sh/g/ek.v12/passthru) — Package provides Reader and Writer with information about the amount of data being passed -- [`passwd`](https://kaos.sh/g/ek.v12/passwd) — Package contains methods for working with passwords -- [`path`](https://kaos.sh/g/ek.v12/path) — Package for working with paths (_fully compatible with base path package_) -- [`pid`](https://kaos.sh/g/ek.v12/pid) — Package for working with PID files -- [`pluralize`](https://kaos.sh/g/ek.v12/pluralize) — Package provides methods for pluralization -- [`progress`](https://kaos.sh/g/ek.v12/progress) — Package provides methods and structs for creating terminal progress bar -- [`protip`](https://kaos.sh/g/ek.v12/protip) — Package for displaying usage tips -- [`rand`](https://kaos.sh/g/ek.v12/rand) — Package for generating random data -- [`req`](https://kaos.sh/g/ek.v12/req) — Package simplify working with an HTTP requests -- [`secstr`](https://kaos.sh/g/ek.v12/secstr) — Package provides methods and structs for working with protected (_secure_) strings -- [`signal`](https://kaos.sh/g/ek.v12/signal) — Package provides methods for handling POSIX signals -- [`sliceutil`](https://kaos.sh/g/ek.v12/sliceutil) — Package provides methods for working with slices -- [`sortutil`](https://kaos.sh/g/ek.v12/sortutil) — Package provides methods for sorting slices -- [`spellcheck`](https://kaos.sh/g/ek.v12/spellcheck) — Package provides spellcheck based on Damerau–Levenshtein distance algorithm -- [`spinner`](https://kaos.sh/g/ek.v12/spinner) — Package provides methods for creating spinner animation for long-running tasks -- [`strutil`](https://kaos.sh/g/ek.v12/strutil) — Package provides methods for working with strings -- [`support`](https://kaos.sh/g/ek.v12/support) — Package provides methods for collecting and printing support information about system -- [`system/container`](https://kaos.sh/g/ek.v12/system/container) — Package provides methods for checking container engine info -- [`system/exec`](https://kaos.sh/g/ek.v12/system/exec) — Package provides methods for executing commands -- [`system/process`](https://kaos.sh/g/ek.v12/system/process) — Package provides methods for gathering information about active processes -- [`system/procname`](https://kaos.sh/g/ek.v12/system/procname) — Package provides methods for changing process name in the process tree -- [`system/sensors`](https://kaos.sh/g/ek.v12/system/sensors) — Package provide methods for collecting sensors information -- [`system`](https://kaos.sh/g/ek.v12/system) — Package provides methods for working with system data (_system metrics/users_) -- [`terminal`](https://kaos.sh/g/ek.v12/terminal) — Package provides methods for printing messages to terminal -- [`terminal/input`](https://kaos.sh/g/ek.v12/terminal/input) — Package provides methods for working with user input -- [`terminal/tty`](https://kaos.sh/g/ek.v12/terminal/tty) — Package provides methods for working with TTY -- [`timeutil`](https://kaos.sh/g/ek.v12/timeutil) — Package provides methods for working with time and date -- [`tmp`](https://kaos.sh/g/ek.v12/tmp) — Package provides methods for working with temporary data -- [`usage`](https://kaos.sh/g/ek.v12/usage) — Package usage provides methods and structs for generating usage info for command-line tools -- [`usage/update`](https://kaos.sh/g/ek.v12/usage/update) — Package contains update checkers for different services -- [`usage/completion/bash`](https://kaos.sh/g/ek.v12/usage/completion/bash) — Package provides methods for generating bash completion -- [`usage/completion/fish`](https://kaos.sh/g/ek.v12/usage/completion/fish) — Package provides methods for generating fish completion -- [`usage/completion/zsh`](https://kaos.sh/g/ek.v12/usage/completion/zsh) — Package provides methods for generating zsh completion -- [`uuid`](https://kaos.sh/g/ek.v12/uuid) — Package provides methods for generating version 4 and 5 UUID's -- [`version`](https://kaos.sh/g/ek.v12/version) — Package version provides methods for working with semver version info +- [`ansi`](https://kaos.sh/g/ek.v13/ansi) — Package provides methods for working with ANSI/VT100 control sequences +- [`cache`](https://kaos.sh/g/ek.v13/cache) — Package provides a simple in-memory key/value cache +- [`color`](https://kaos.sh/g/ek.v13/color) — Package provides methods for working with colors +- [`cron`](https://kaos.sh/g/ek.v13/cron) — Package provides methods for working with cron expressions +- [`csv`](https://kaos.sh/g/ek.v13/csv) — Package with simple CSV parser compatible with default Go parser +- [`easing`](https://kaos.sh/g/ek.v13/easing) — Package with easing functions (_Back, Bounce, Circ, Cubic, Elastic, Expo, Linear, Quad, Quint, Sine_) +- [`emoji`](https://kaos.sh/g/ek.v13/emoji) — Package provides methods for working with emojis +- [`env`](https://kaos.sh/g/ek.v13/env) — Package provides methods for working with environment variables +- [`errutil`](https://kaos.sh/g/ek.v13/errutil) — Package provides methods for working with errors +- [`events`](https://kaos.sh/g/ek.v13/events) — Package provides methods and structs for creating event-driven systems +- [`directio`](https://kaos.sh/g/ek.v13/directio) — Package provides methods for reading/writing files with direct io +- [`fmtc`](https://kaos.sh/g/ek.v13/fmtc) — Package provides methods similar to fmt for colored output ([_more info and examples_](fmtc/README.md)) +- [`fmtutil`](https://kaos.sh/g/ek.v13/fmtutil) — Package provides methods for output formatting +- [`fmtutil/barcode`](https://kaos.sh/g/ek.v13/fmtutil/barcode) — Package provides methods to generate colored representation of unique data +- [`fmtutil/panel`](https://kaos.sh/g/ek.v13/fmtutil/panel) — Package contains methods for rendering panels with text +- [`fmtutil/table`](https://kaos.sh/g/ek.v13/fmtutil/table) — Package contains methods and structs for rendering data in tabular format +- [`fsutil`](https://kaos.sh/g/ek.v13/fsutil) — Package provides methods for working with files on POSIX compatible systems (_BSD/Linux/macOS_) +- [`hash`](https://kaos.sh/g/ek.v13/hash) — Package hash contains different hash algorithms and utilities +- [`httputil`](https://kaos.sh/g/ek.v13/httputil) — Package provides methods for working with HTTP request/responses +- [`i18n`](https://kaos.sh/g/ek.v13/i18n) — Package provides methods and structs for internationalization +- [`initsystem`](https://kaos.sh/g/ek.v13/initsystem) — Package provides methods for working with different init systems (_sysv, upstart, systemd_) +- [`initsystem/sdnotify`](https://kaos.sh/g/ek.v13/initsystem/sdnotify) — Package provides methods methods for sending [notifications to systemd](https://www.freedesktop.org/software/systemd/man/latest/sd_notify.html#Well-known%20assignments) +- [`jsonutil`](https://kaos.sh/g/ek.v13/jsonutil) — Package provides methods for working with JSON data +- [`knf`](https://kaos.sh/g/ek.v13/knf) — Package provides methods for working with configuration files in [KNF format](https://kaos.sh/knf-spec) +- [`knf/united`](https://kaos.sh/g/ek.v13/knf/united) — Package provides united configuration (_knf + options + environment variables_) +- [`log`](https://kaos.sh/g/ek.v13/log) — Package with an improved logger +- [`lock`](https://kaos.sh/g/ek.v13/lock) — Package provides methods for working with lock files +- [`lscolors`](https://kaos.sh/g/ek.v13/lscolors) — Package provides methods for colorizing file names based on colors from dircolors +- [`mathutil`](https://kaos.sh/g/ek.v13/mathutil) — Package provides some additional math methods +- [`netutil`](https://kaos.sh/g/ek.v13/netutil) — Package provides methods for working with network +- [`options`](https://kaos.sh/g/ek.v13/options) — Package provides methods for working with command-line options +- [`pager`](https://kaos.sh/g/ek.v13/pager) — Package provides methods for pager setup (_like_ `more`/`less`) +- [`passthru`](https://kaos.sh/g/ek.v13/passthru) — Package provides Reader and Writer with information about the amount of data being passed +- [`passwd`](https://kaos.sh/g/ek.v13/passwd) — Package contains methods for working with passwords +- [`path`](https://kaos.sh/g/ek.v13/path) — Package for working with paths (_fully compatible with base path package_) +- [`pid`](https://kaos.sh/g/ek.v13/pid) — Package for working with PID files +- [`pluralize`](https://kaos.sh/g/ek.v13/pluralize) — Package provides methods for pluralization +- [`progress`](https://kaos.sh/g/ek.v13/progress) — Package provides methods and structs for creating terminal progress bar +- [`protip`](https://kaos.sh/g/ek.v13/protip) — Package for displaying usage tips +- [`rand`](https://kaos.sh/g/ek.v13/rand) — Package for generating random data +- [`req`](https://kaos.sh/g/ek.v13/req) — Package simplify working with an HTTP requests +- [`secstr`](https://kaos.sh/g/ek.v13/secstr) — Package provides methods and structs for working with protected (_secure_) strings +- [`signal`](https://kaos.sh/g/ek.v13/signal) — Package provides methods for handling POSIX signals +- [`sliceutil`](https://kaos.sh/g/ek.v13/sliceutil) — Package provides methods for working with slices +- [`sortutil`](https://kaos.sh/g/ek.v13/sortutil) — Package provides methods for sorting slices +- [`spellcheck`](https://kaos.sh/g/ek.v13/spellcheck) — Package provides spellcheck based on Damerau–Levenshtein distance algorithm +- [`spinner`](https://kaos.sh/g/ek.v13/spinner) — Package provides methods for creating spinner animation for long-running tasks +- [`strutil`](https://kaos.sh/g/ek.v13/strutil) — Package provides methods for working with strings +- [`support`](https://kaos.sh/g/ek.v13/support) — Package provides methods for collecting and printing support information about system +- [`system/container`](https://kaos.sh/g/ek.v13/system/container) — Package provides methods for checking container engine info +- [`system/exec`](https://kaos.sh/g/ek.v13/system/exec) — Package provides methods for executing commands +- [`system/process`](https://kaos.sh/g/ek.v13/system/process) — Package provides methods for gathering information about active processes +- [`system/procname`](https://kaos.sh/g/ek.v13/system/procname) — Package provides methods for changing process name in the process tree +- [`system/sensors`](https://kaos.sh/g/ek.v13/system/sensors) — Package provide methods for collecting sensors information +- [`system`](https://kaos.sh/g/ek.v13/system) — Package provides methods for working with system data (_system metrics/users_) +- [`terminal`](https://kaos.sh/g/ek.v13/terminal) — Package provides methods for printing messages to terminal +- [`terminal/input`](https://kaos.sh/g/ek.v13/terminal/input) — Package provides methods for working with user input +- [`terminal/tty`](https://kaos.sh/g/ek.v13/terminal/tty) — Package provides methods for working with TTY +- [`timeutil`](https://kaos.sh/g/ek.v13/timeutil) — Package provides methods for working with time and date +- [`tmp`](https://kaos.sh/g/ek.v13/tmp) — Package provides methods for working with temporary data +- [`usage`](https://kaos.sh/g/ek.v13/usage) — Package usage provides methods and structs for generating usage info for command-line tools +- [`usage/update`](https://kaos.sh/g/ek.v13/usage/update) — Package contains update checkers for different services +- [`usage/completion/bash`](https://kaos.sh/g/ek.v13/usage/completion/bash) — Package provides methods for generating bash completion +- [`usage/completion/fish`](https://kaos.sh/g/ek.v13/usage/completion/fish) — Package provides methods for generating fish completion +- [`usage/completion/zsh`](https://kaos.sh/g/ek.v13/usage/completion/zsh) — Package provides methods for generating zsh completion +- [`uuid`](https://kaos.sh/g/ek.v13/uuid) — Package provides methods for generating version 4 and 5 UUID's +- [`version`](https://kaos.sh/g/ek.v13/version) — Package version provides methods for working with semver version info ### Projects with `EK` diff --git a/color/color.go b/color/color.go index 5a106eeb..fee183be 100644 --- a/color/color.go +++ b/color/color.go @@ -13,7 +13,7 @@ import ( "math" "strconv" - "github.com/essentialkaos/ek/v12/mathutil" + "github.com/essentialkaos/ek/v13/mathutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/color/color_test.go b/color/color_test.go index cc1cad83..c515c81f 100644 --- a/color/color_test.go +++ b/color/color_test.go @@ -10,7 +10,7 @@ package color import ( "testing" - "github.com/essentialkaos/ek/v12/mathutil" + "github.com/essentialkaos/ek/v13/mathutil" . "github.com/essentialkaos/check" ) diff --git a/cron/cron.go b/cron/cron.go index 81fce33e..332070f5 100644 --- a/cron/cron.go +++ b/cron/cron.go @@ -15,7 +15,7 @@ import ( "strings" "time" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/ek.go b/ek.go index 90952ccb..9c5ecce9 100644 --- a/ek.go +++ b/ek.go @@ -21,7 +21,7 @@ import ( // ////////////////////////////////////////////////////////////////////////////////// // // VERSION is current ek package version -const VERSION = "12.130.0" +const VERSION = "13.0.0" // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/fmtc/fmtc.go b/fmtc/fmtc.go index 298a2d42..3779fc61 100644 --- a/fmtc/fmtc.go +++ b/fmtc/fmtc.go @@ -18,8 +18,8 @@ import ( "strings" "sync" - "github.com/essentialkaos/ek/v12/color" - "github.com/essentialkaos/ek/v12/env" + "github.com/essentialkaos/ek/v13/color" + "github.com/essentialkaos/ek/v13/env" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/fmtc/fmtc_test.go b/fmtc/fmtc_test.go index 136b638f..3659b09b 100644 --- a/fmtc/fmtc_test.go +++ b/fmtc/fmtc_test.go @@ -13,7 +13,7 @@ import ( "os" "testing" - "github.com/essentialkaos/ek/v12/env" + "github.com/essentialkaos/ek/v13/env" . "github.com/essentialkaos/check" ) diff --git a/fmtutil/fmtutil.go b/fmtutil/fmtutil.go index 41b0349a..37b56525 100644 --- a/fmtutil/fmtutil.go +++ b/fmtutil/fmtutil.go @@ -15,9 +15,9 @@ import ( "strconv" "strings" - "github.com/essentialkaos/ek/v12/ansi" - "github.com/essentialkaos/ek/v12/mathutil" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/ansi" + "github.com/essentialkaos/ek/v13/mathutil" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/fmtutil/panel/panel.go b/fmtutil/panel/panel.go index 6c9770f6..b10aea89 100644 --- a/fmtutil/panel/panel.go +++ b/fmtutil/panel/panel.go @@ -12,11 +12,11 @@ import ( "bytes" "strings" - "github.com/essentialkaos/ek/v12/fmtc" - "github.com/essentialkaos/ek/v12/fmtutil" - "github.com/essentialkaos/ek/v12/mathutil" - "github.com/essentialkaos/ek/v12/sliceutil" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/fmtc" + "github.com/essentialkaos/ek/v13/fmtutil" + "github.com/essentialkaos/ek/v13/mathutil" + "github.com/essentialkaos/ek/v13/sliceutil" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/fmtutil/panel/panel_test.go b/fmtutil/panel/panel_test.go index a4acb8cd..93cf61a3 100644 --- a/fmtutil/panel/panel_test.go +++ b/fmtutil/panel/panel_test.go @@ -10,7 +10,7 @@ package panel import ( "testing" - "github.com/essentialkaos/ek/v12/fmtc" + "github.com/essentialkaos/ek/v13/fmtc" . "github.com/essentialkaos/check" ) diff --git a/fmtutil/separator.go b/fmtutil/separator.go index 25f429e0..5a682e47 100644 --- a/fmtutil/separator.go +++ b/fmtutil/separator.go @@ -10,8 +10,8 @@ package fmtutil import ( "strings" - "github.com/essentialkaos/ek/v12/fmtc" - "github.com/essentialkaos/ek/v12/terminal/tty" + "github.com/essentialkaos/ek/v13/fmtc" + "github.com/essentialkaos/ek/v13/terminal/tty" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/fmtutil/table/table.go b/fmtutil/table/table.go index 79de426a..06f71043 100644 --- a/fmtutil/table/table.go +++ b/fmtutil/table/table.go @@ -12,10 +12,10 @@ import ( "fmt" "strings" - "github.com/essentialkaos/ek/v12/fmtc" - "github.com/essentialkaos/ek/v12/mathutil" - "github.com/essentialkaos/ek/v12/strutil" - "github.com/essentialkaos/ek/v12/terminal/tty" + "github.com/essentialkaos/ek/v13/fmtc" + "github.com/essentialkaos/ek/v13/mathutil" + "github.com/essentialkaos/ek/v13/strutil" + "github.com/essentialkaos/ek/v13/terminal/tty" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/fsutil/fs.go b/fsutil/fs.go index 446aeff6..b144cdf4 100644 --- a/fsutil/fs.go +++ b/fsutil/fs.go @@ -20,8 +20,8 @@ import ( "syscall" "time" - PATH "github.com/essentialkaos/ek/v12/path" - "github.com/essentialkaos/ek/v12/system" + PATH "github.com/essentialkaos/ek/v13/path" + "github.com/essentialkaos/ek/v13/system" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/fsutil/fs_darwin.go b/fsutil/fs_darwin.go index 5279e804..e985362f 100644 --- a/fsutil/fs_darwin.go +++ b/fsutil/fs_darwin.go @@ -15,7 +15,7 @@ import ( "syscall" "time" - PATH "github.com/essentialkaos/ek/v12/path" + PATH "github.com/essentialkaos/ek/v13/path" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/fsutil/fs_freebsd.go b/fsutil/fs_freebsd.go index 9e4d70e1..4502b79f 100644 --- a/fsutil/fs_freebsd.go +++ b/fsutil/fs_freebsd.go @@ -15,7 +15,7 @@ import ( "syscall" "time" - PATH "github.com/essentialkaos/ek/v12/path" + PATH "github.com/essentialkaos/ek/v13/path" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/fsutil/fs_linux.go b/fsutil/fs_linux.go index 85ae5160..6fe0c26c 100644 --- a/fsutil/fs_linux.go +++ b/fsutil/fs_linux.go @@ -15,7 +15,7 @@ import ( "syscall" "time" - PATH "github.com/essentialkaos/ek/v12/path" + PATH "github.com/essentialkaos/ek/v13/path" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/fsutil/fs_test.go b/fsutil/fs_test.go index cabe3308..23d1f2bf 100644 --- a/fsutil/fs_test.go +++ b/fsutil/fs_test.go @@ -15,7 +15,7 @@ import ( "testing" "time" - "github.com/essentialkaos/ek/v12/system" + "github.com/essentialkaos/ek/v13/system" check "github.com/essentialkaos/check" ) diff --git a/fsutil/fs_user.go b/fsutil/fs_user.go index f9064963..cbd6cee4 100644 --- a/fsutil/fs_user.go +++ b/fsutil/fs_user.go @@ -12,7 +12,7 @@ package fsutil // ////////////////////////////////////////////////////////////////////////////////// // import ( - "github.com/essentialkaos/ek/v12/system" + "github.com/essentialkaos/ek/v13/system" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/fsutil/fs_user_unit.go b/fsutil/fs_user_unit.go index 3cf11668..183d6356 100644 --- a/fsutil/fs_user_unit.go +++ b/fsutil/fs_user_unit.go @@ -13,7 +13,7 @@ package fsutil import ( "errors" - "github.com/essentialkaos/ek/v12/system" + "github.com/essentialkaos/ek/v13/system" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/go.mod b/go.mod index bb4f35a2..139ae8ac 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/essentialkaos/ek/v12 +module github.com/essentialkaos/ek/v13 go 1.18 diff --git a/i18n/i18n.go b/i18n/i18n.go index 3730d1e5..b704b11d 100644 --- a/i18n/i18n.go +++ b/i18n/i18n.go @@ -15,8 +15,8 @@ import ( "strings" "text/template" - "github.com/essentialkaos/ek/v12/fmtutil" - "github.com/essentialkaos/ek/v12/pluralize" + "github.com/essentialkaos/ek/v13/fmtutil" + "github.com/essentialkaos/ek/v13/pluralize" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/initsystem/initsystem.go b/initsystem/initsystem.go index 84a4565b..0c78d0ee 100644 --- a/initsystem/initsystem.go +++ b/initsystem/initsystem.go @@ -20,9 +20,9 @@ import ( "strings" "syscall" - "github.com/essentialkaos/ek/v12/env" - "github.com/essentialkaos/ek/v12/fsutil" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/env" + "github.com/essentialkaos/ek/v13/fsutil" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/initsystem/initsystem_darwin.go b/initsystem/initsystem_darwin.go index 997a6159..4618ead7 100644 --- a/initsystem/initsystem_darwin.go +++ b/initsystem/initsystem_darwin.go @@ -14,7 +14,7 @@ import ( "os/exec" "strings" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/jsonutil/jsonutil_test.go b/jsonutil/jsonutil_test.go index 7ee8a486..b3fa5502 100644 --- a/jsonutil/jsonutil_test.go +++ b/jsonutil/jsonutil_test.go @@ -14,7 +14,7 @@ import ( . "github.com/essentialkaos/check" - "github.com/essentialkaos/ek/v12/fsutil" + "github.com/essentialkaos/ek/v13/fsutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/knf/knf.go b/knf/knf.go index ad2102d1..fc02da28 100644 --- a/knf/knf.go +++ b/knf/knf.go @@ -18,8 +18,8 @@ import ( "sync" "time" - "github.com/essentialkaos/ek/v12/knf/value" - "github.com/essentialkaos/ek/v12/sliceutil" + "github.com/essentialkaos/ek/v13/knf/value" + "github.com/essentialkaos/ek/v13/sliceutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/knf/united/example_test.go b/knf/united/example_test.go index 915d9a60..c3e4c890 100644 --- a/knf/united/example_test.go +++ b/knf/united/example_test.go @@ -10,8 +10,8 @@ package united import ( "fmt" - "github.com/essentialkaos/ek/v12/knf" - "github.com/essentialkaos/ek/v12/options" + "github.com/essentialkaos/ek/v13/knf" + "github.com/essentialkaos/ek/v13/options" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/knf/united/united.go b/knf/united/united.go index 3e7b7eed..2040b372 100644 --- a/knf/united/united.go +++ b/knf/united/united.go @@ -13,10 +13,10 @@ import ( "strings" "time" - "github.com/essentialkaos/ek/v12/knf" - "github.com/essentialkaos/ek/v12/knf/value" - "github.com/essentialkaos/ek/v12/options" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/knf" + "github.com/essentialkaos/ek/v13/knf/value" + "github.com/essentialkaos/ek/v13/options" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/knf/united/united_test.go b/knf/united/united_test.go index fed5bafe..b3acf0d9 100644 --- a/knf/united/united_test.go +++ b/knf/united/united_test.go @@ -12,10 +12,10 @@ import ( "testing" "time" - "github.com/essentialkaos/ek/v12/knf" - "github.com/essentialkaos/ek/v12/options" + "github.com/essentialkaos/ek/v13/knf" + "github.com/essentialkaos/ek/v13/options" - knfv "github.com/essentialkaos/ek/v12/knf/validators" + knfv "github.com/essentialkaos/ek/v13/knf/validators" . "github.com/essentialkaos/check" ) @@ -257,7 +257,7 @@ func (s *UnitedSuite) TestValidation(c *C) { global = nil errs := Validate([]*knf.Validator{ - {"test:string", knfv.Empty, nil}, + {"test:string", knfv.Set, nil}, }) c.Assert(errs, HasLen, 1) @@ -278,8 +278,8 @@ func (s *UnitedSuite) TestValidation(c *C) { c.Assert(err, IsNil) errs = Validate([]*knf.Validator{ - {"test:string", knfv.Empty, nil}, - {"test:integer", knfv.Greater, 100}, + {"test:string", knfv.Set, nil}, + {"test:integer", knfv.Less, 100}, }) c.Assert(errs, HasLen, 1) diff --git a/knf/validators/fs/validators.go b/knf/validators/fs/validators.go index e667eca6..5a5b46ae 100644 --- a/knf/validators/fs/validators.go +++ b/knf/validators/fs/validators.go @@ -12,10 +12,10 @@ import ( "fmt" "os" - "github.com/essentialkaos/ek/v12/fsutil" - "github.com/essentialkaos/ek/v12/knf" - "github.com/essentialkaos/ek/v12/path" - "github.com/essentialkaos/ek/v12/system" + "github.com/essentialkaos/ek/v13/fsutil" + "github.com/essentialkaos/ek/v13/knf" + "github.com/essentialkaos/ek/v13/path" + "github.com/essentialkaos/ek/v13/system" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/knf/validators/fs/validators_test.go b/knf/validators/fs/validators_test.go index 58995917..e4caf09e 100644 --- a/knf/validators/fs/validators_test.go +++ b/knf/validators/fs/validators_test.go @@ -13,7 +13,7 @@ import ( "runtime" "testing" - "github.com/essentialkaos/ek/v12/knf" + "github.com/essentialkaos/ek/v13/knf" . "github.com/essentialkaos/check" ) diff --git a/knf/validators/network/validators.go b/knf/validators/network/validators.go index 522bedad..6ab0c262 100644 --- a/knf/validators/network/validators.go +++ b/knf/validators/network/validators.go @@ -14,7 +14,7 @@ import ( "net/url" "strings" - "github.com/essentialkaos/ek/v12/knf" + "github.com/essentialkaos/ek/v13/knf" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/knf/validators/network/validators_test.go b/knf/validators/network/validators_test.go index b7d655b9..c7643487 100644 --- a/knf/validators/network/validators_test.go +++ b/knf/validators/network/validators_test.go @@ -11,7 +11,7 @@ import ( "os" "testing" - "github.com/essentialkaos/ek/v12/knf" + "github.com/essentialkaos/ek/v13/knf" . "github.com/essentialkaos/check" ) diff --git a/knf/validators/regexp/validators.go b/knf/validators/regexp/validators.go index 83097f53..4417f051 100644 --- a/knf/validators/regexp/validators.go +++ b/knf/validators/regexp/validators.go @@ -12,7 +12,7 @@ import ( "fmt" "regexp" - "github.com/essentialkaos/ek/v12/knf" + "github.com/essentialkaos/ek/v13/knf" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/knf/validators/regexp/validators_test.go b/knf/validators/regexp/validators_test.go index f09bdffe..7212c840 100644 --- a/knf/validators/regexp/validators_test.go +++ b/knf/validators/regexp/validators_test.go @@ -11,7 +11,7 @@ import ( "os" "testing" - "github.com/essentialkaos/ek/v12/knf" + "github.com/essentialkaos/ek/v13/knf" check "github.com/essentialkaos/check" ) diff --git a/knf/validators/system/validators.go b/knf/validators/system/validators.go index 8a9944fa..290c2c35 100644 --- a/knf/validators/system/validators.go +++ b/knf/validators/system/validators.go @@ -12,8 +12,8 @@ package system import ( "fmt" - "github.com/essentialkaos/ek/v12/knf" - "github.com/essentialkaos/ek/v12/system" + "github.com/essentialkaos/ek/v13/knf" + "github.com/essentialkaos/ek/v13/system" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/knf/validators/system/validators_linux.go b/knf/validators/system/validators_linux.go index fae83c11..ad7018f9 100644 --- a/knf/validators/system/validators_linux.go +++ b/knf/validators/system/validators_linux.go @@ -12,8 +12,8 @@ package system import ( "fmt" - "github.com/essentialkaos/ek/v12/knf" - "github.com/essentialkaos/ek/v12/system" + "github.com/essentialkaos/ek/v13/knf" + "github.com/essentialkaos/ek/v13/system" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/knf/validators/system/validators_linux_test.go b/knf/validators/system/validators_linux_test.go index e521fabc..039afe92 100644 --- a/knf/validators/system/validators_linux_test.go +++ b/knf/validators/system/validators_linux_test.go @@ -8,7 +8,7 @@ package system // ////////////////////////////////////////////////////////////////////////////////// // import ( - "github.com/essentialkaos/ek/v12/knf" + "github.com/essentialkaos/ek/v13/knf" . "github.com/essentialkaos/check" ) diff --git a/knf/validators/system/validators_test.go b/knf/validators/system/validators_test.go index 5d5a600a..078e0663 100644 --- a/knf/validators/system/validators_test.go +++ b/knf/validators/system/validators_test.go @@ -11,7 +11,7 @@ import ( "os" "testing" - "github.com/essentialkaos/ek/v12/knf" + "github.com/essentialkaos/ek/v13/knf" . "github.com/essentialkaos/check" ) diff --git a/knf/validators/validators.go b/knf/validators/validators.go index ee560602..c19f64f1 100644 --- a/knf/validators/validators.go +++ b/knf/validators/validators.go @@ -13,8 +13,8 @@ import ( "strconv" "strings" - "github.com/essentialkaos/ek/v12/knf" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/knf" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // @@ -36,26 +36,26 @@ var ( // Greater returns error if property is greater than given number Greater = validatorGreater - // Equals returns error if property is equal to given string - Equals = validatorEquals + // NotEquals returns error if property is equal to given string + NotEquals = validatorNotEquals - // LenLess returns an error if the length of the property value is less than + // LenLess returns an error if the length of the property value is greater than // given number LenLess = validatorLenLess - // LenGreater returns an error if the length of the property value is greater than + // LenGreater returns an error if the length of the property value is less than // given number LenGreater = validatorLenGreater // LenNotEquals an error if the length of the property value is not equal to the // given number - LenNotEquals = validatorLenNotEquals + LenEquals = validatorLenEquals - // NotPrefix returns error if property doesn't have given prefix - NotPrefix = validatorNotPrefix + // HasPrefix returns error if property doesn't have given prefix + HasPrefix = validatorHasPrefix - // NotPrefix returns error if property doesn't have given suffix - NotSuffix = validatorNotSuffix + // HasSuffix returns error if property doesn't have given suffix + HasSuffix = validatorHasSuffix // TypeBool returns error if property contains non-boolean value TypeBool = validatorTypeBool @@ -67,23 +67,6 @@ var ( TypeFloat = validatorTypeFloat ) -var ( - // Empty returns error if property is empty - // - // Deprecated: Use validator Set instead - Empty = validatorSet - - // NotContains returns error if property doesn't contains value from given slice - // - // Deprecated: Use validator SetToAny instead - NotContains = validatorSetToAny - - // NotLen returns error if property has wrong size - // - // Deprecated: Use validator LenNotEquals instead - NotLen = validatorNotLen -) - // ////////////////////////////////////////////////////////////////////////////////// // func validatorSet(config knf.IConfig, prop string, value any) error { @@ -175,13 +158,13 @@ func validatorSetToAnyIgnoreCase(config knf.IConfig, prop string, value any) err func validatorLess(config knf.IConfig, prop string, value any) error { switch t := value.(type) { case int: - if config.GetI(prop) < t { - return fmt.Errorf("Property %s can't be less than %d", prop, t) + if config.GetI(prop) > t { + return fmt.Errorf("Property %s can't be greater than %d", prop, t) } case float64: - if config.GetF(prop) < t { - return fmt.Errorf("Property %s can't be less than %g", prop, t) + if config.GetF(prop) > t { + return fmt.Errorf("Property %s can't be greater than %g", prop, t) } default: @@ -194,13 +177,13 @@ func validatorLess(config knf.IConfig, prop string, value any) error { func validatorGreater(config knf.IConfig, prop string, value any) error { switch t := value.(type) { case int: - if config.GetI(prop) > t { - return fmt.Errorf("Property %s can't be greater than %d", prop, t) + if config.GetI(prop) < t { + return fmt.Errorf("Property %s can't be less than %d", prop, t) } case float64: - if config.GetF(prop) > t { - return fmt.Errorf("Property %s can't be greater than %g", prop, t) + if config.GetF(prop) < t { + return fmt.Errorf("Property %s can't be less than %g", prop, t) } default: @@ -210,7 +193,7 @@ func validatorGreater(config knf.IConfig, prop string, value any) error { return nil } -func validatorEquals(config knf.IConfig, prop string, value any) error { +func validatorNotEquals(config knf.IConfig, prop string, value any) error { switch t := value.(type) { case int: if config.GetI(prop) == t { @@ -233,7 +216,7 @@ func validatorEquals(config knf.IConfig, prop string, value any) error { } default: - return getValidatorInputError("Equals", prop, value) + return getValidatorInputError("NotEquals", prop, value) } return nil @@ -242,8 +225,8 @@ func validatorEquals(config knf.IConfig, prop string, value any) error { func validatorLenLess(config knf.IConfig, prop string, value any) error { switch t := value.(type) { case int: - if strutil.Len(config.GetS(prop)) < t { - return fmt.Errorf("Property %s value can't be shorter than %d symbols", prop, t) + if strutil.Len(config.GetS(prop)) > t { + return fmt.Errorf("Property %s value can't be longer than %d symbols", prop, t) } default: @@ -256,8 +239,8 @@ func validatorLenLess(config knf.IConfig, prop string, value any) error { func validatorLenGreater(config knf.IConfig, prop string, value any) error { switch t := value.(type) { case int: - if strutil.Len(config.GetS(prop)) > t { - return fmt.Errorf("Property %s value can't be longer than %d symbols", prop, t) + if strutil.Len(config.GetS(prop)) < t { + return fmt.Errorf("Property %s value can't be shorter than %d symbols", prop, t) } default: @@ -267,7 +250,7 @@ func validatorLenGreater(config knf.IConfig, prop string, value any) error { return nil } -func validatorLenNotEquals(config knf.IConfig, prop string, value any) error { +func validatorLenEquals(config knf.IConfig, prop string, value any) error { switch t := value.(type) { case int: if strutil.Len(config.GetS(prop)) != t { @@ -275,17 +258,17 @@ func validatorLenNotEquals(config knf.IConfig, prop string, value any) error { } default: - return getValidatorInputError("LenNotEquals", prop, value) + return getValidatorInputError("LenEquals", prop, value) } return nil } -func validatorNotPrefix(config knf.IConfig, prop string, value any) error { +func validatorHasPrefix(config knf.IConfig, prop string, value any) error { switch t := value.(type) { case string: if t == "" { - return getValidatorEmptyInputError("NotPrefix", prop) + return getValidatorEmptyInputError("HasPrefix", prop) } if !strings.HasPrefix(config.GetS(prop), t) { @@ -293,17 +276,17 @@ func validatorNotPrefix(config knf.IConfig, prop string, value any) error { } default: - return getValidatorInputError("NotPrefix", prop, value) + return getValidatorInputError("HasPrefix", prop, value) } return nil } -func validatorNotSuffix(config knf.IConfig, prop string, value any) error { +func validatorHasSuffix(config knf.IConfig, prop string, value any) error { switch t := value.(type) { case string: if t == "" { - return getValidatorEmptyInputError("NotSuffix", prop) + return getValidatorEmptyInputError("HasSuffix", prop) } if !strings.HasSuffix(config.GetS(prop), t) { @@ -311,22 +294,7 @@ func validatorNotSuffix(config knf.IConfig, prop string, value any) error { } default: - return getValidatorInputError("NotSuffix", prop, value) - } - - return nil -} - -// Deprecated -func validatorNotLen(config knf.IConfig, prop string, value any) error { - switch t := value.(type) { - case int: - if strutil.Len(config.GetS(prop)) != t { - return fmt.Errorf("Property %s must be %d symbols long", prop, t) - } - - default: - return getValidatorInputError("NotLen", prop, value) + return getValidatorInputError("HasSuffix", prop, value) } return nil diff --git a/knf/validators/validators_test.go b/knf/validators/validators_test.go index f9981c4d..925f1941 100644 --- a/knf/validators/validators_test.go +++ b/knf/validators/validators_test.go @@ -11,7 +11,7 @@ import ( "os" "testing" - "github.com/essentialkaos/ek/v12/knf" + "github.com/essentialkaos/ek/v13/knf" check "github.com/essentialkaos/check" ) @@ -43,7 +43,7 @@ test1: 1 test7: no [integer] - test1: 1 + test1: 5 test2: -5 test3: 10000000 test4: A @@ -104,50 +104,50 @@ func (s *ValidatorSuite) TestBasicValidators(c *check.C) { errs = knf.Validate([]*knf.Validator{ {"integer:test1", Set, nil}, - {"integer:test1", Less, 0}, - {"integer:test1", Less, 0.5}, - {"integer:test1", Greater, 10}, - {"integer:test1", Greater, 10.1}, - {"integer:test1", Equals, 10}, - {"integer:test1", Equals, 10.1}, - {"integer:test1", Equals, "123"}, - {"string:test3", NotPrefix, "45"}, - {"string:test3", NotSuffix, "00"}, - {"string:test1", LenLess, 3}, - {"string:test1", LenGreater, 10}, - {"string:test1", LenNotEquals, 4}, + {"integer:test1", Greater, 0}, + {"integer:test1", Greater, 0.5}, + {"integer:test1", Less, 10}, + {"integer:test1", Less, 10.1}, + {"integer:test1", NotEquals, 10}, + {"integer:test1", NotEquals, 10.1}, + {"integer:test1", NotEquals, "123"}, + {"string:test3", HasPrefix, "45"}, + {"string:test3", HasSuffix, "00"}, + {"string:test1", LenGreater, 3}, + {"string:test1", LenLess, 10}, + {"string:test1", LenEquals, 4}, }) c.Assert(errs, check.HasLen, 0) errs = knf.Validate([]*knf.Validator{ {"boolean:test5", Set, nil}, - {"integer:test1", Less, 10}, - {"integer:test1", Greater, 0}, - {"integer:test1", Equals, 1}, + {"integer:test1", Greater, 10}, + {"integer:test1", Less, 3}, + {"integer:test1", NotEquals, 5}, {"integer:test1", Greater, "12345"}, {"integer:test1", SetToAny, []string{"A", "B", "C"}}, {"integer:test1", SetToAnyIgnoreCase, []string{"A", "B", "C"}}, - {"string:test3", NotPrefix, "AB"}, - {"string:test3", NotSuffix, "CD"}, - {"string:test1", LenLess, 10}, - {"string:test1", LenGreater, 3}, - {"string:test1", LenNotEquals, 10}, + {"string:test3", HasPrefix, "AB"}, + {"string:test3", HasSuffix, "CD"}, + {"string:test1", LenLess, 3}, + {"string:test1", LenGreater, 10}, + {"string:test1", LenEquals, 10}, }) c.Assert(errs, check.HasLen, 12) c.Assert(errs[0].Error(), check.Equals, "Property boolean:test5 must be set") c.Assert(errs[1].Error(), check.Equals, "Property integer:test1 can't be less than 10") - c.Assert(errs[2].Error(), check.Equals, "Property integer:test1 can't be greater than 0") - c.Assert(errs[3].Error(), check.Equals, "Property integer:test1 can't be equal 1") + c.Assert(errs[2].Error(), check.Equals, "Property integer:test1 can't be greater than 3") + c.Assert(errs[3].Error(), check.Equals, "Property integer:test1 can't be equal 5") c.Assert(errs[4].Error(), check.Equals, "Validator knf.Greater doesn't support input with type for checking integer:test1 property") c.Assert(errs[5].Error(), check.Equals, "Property integer:test1 doesn't contains any valid value") c.Assert(errs[6].Error(), check.Equals, "Property integer:test1 doesn't contains any valid value") c.Assert(errs[7].Error(), check.Equals, `Property string:test3 must have prefix "AB"`) c.Assert(errs[8].Error(), check.Equals, `Property string:test3 must have suffix "CD"`) - c.Assert(errs[9].Error(), check.Equals, "Property string:test1 value can't be shorter than 10 symbols") - c.Assert(errs[10].Error(), check.Equals, "Property string:test1 value can't be longer than 3 symbols") + c.Assert(errs[9].Error(), check.Equals, "Property string:test1 value can't be longer than 3 symbols") + c.Assert(errs[10].Error(), check.Equals, "Property string:test1 value can't be shorter than 10 symbols") c.Assert(errs[11].Error(), check.Equals, "Property string:test1 must be 10 symbols long") fakeConfigFile := createConfig(c, ` @@ -166,31 +166,31 @@ func (s *ValidatorSuite) TestBasicValidators(c *check.C) { c.Assert(Set(fakeConfig, "test:empty", nil), check.NotNil) c.Assert(Set(fakeConfig, "test:string", nil), check.IsNil) - c.Assert(Less(fakeConfig, "test:integer", 30).Error(), check.Equals, "Property test:integer can't be less than 30") - c.Assert(Less(fakeConfig, "test:integer", 5), check.IsNil) - c.Assert(Less(fakeConfig, "test:float", 30.0).Error(), check.Equals, "Property test:float can't be less than 30") - c.Assert(Less(fakeConfig, "test:float", 5.0), check.IsNil) + c.Assert(Less(fakeConfig, "test:integer", 5).Error(), check.Equals, "Property test:integer can't be greater than 5") + c.Assert(Less(fakeConfig, "test:integer", 30), check.IsNil) + c.Assert(Less(fakeConfig, "test:float", 5.1).Error(), check.Equals, "Property test:float can't be greater than 5.1") + c.Assert(Less(fakeConfig, "test:float", 30.1), check.IsNil) - c.Assert(Greater(fakeConfig, "test:integer", 5).Error(), check.Equals, "Property test:integer can't be greater than 5") - c.Assert(Greater(fakeConfig, "test:integer", 30), check.IsNil) - c.Assert(Greater(fakeConfig, "test:float", 5.0).Error(), check.Equals, "Property test:float can't be greater than 5") - c.Assert(Greater(fakeConfig, "test:float", 30.0), check.IsNil) + c.Assert(Greater(fakeConfig, "test:integer", 30).Error(), check.Equals, "Property test:integer can't be less than 30") + c.Assert(Greater(fakeConfig, "test:integer", 5), check.IsNil) + c.Assert(Greater(fakeConfig, "test:float", 30.1).Error(), check.Equals, "Property test:float can't be less than 30.1") + c.Assert(Greater(fakeConfig, "test:float", 5.1), check.IsNil) - c.Assert(Equals(fakeConfig, "test:empty", "").Error(), check.Equals, "Property test:empty can't be equal \"\"") - c.Assert(Equals(fakeConfig, "test:string", "test").Error(), check.Equals, "Property test:string can't be equal \"test\"") - c.Assert(Equals(fakeConfig, "test:integer", 10).Error(), check.Equals, "Property test:integer can't be equal 10") - c.Assert(Equals(fakeConfig, "test:float", 10.0).Error(), check.Equals, "Property test:float can't be equal 10.000000") - c.Assert(Equals(fakeConfig, "test:boolean", false).Error(), check.Equals, "Property test:boolean can't be equal false") + c.Assert(NotEquals(fakeConfig, "test:empty", "").Error(), check.Equals, "Property test:empty can't be equal \"\"") + c.Assert(NotEquals(fakeConfig, "test:string", "test").Error(), check.Equals, "Property test:string can't be equal \"test\"") + c.Assert(NotEquals(fakeConfig, "test:integer", 10).Error(), check.Equals, "Property test:integer can't be equal 10") + c.Assert(NotEquals(fakeConfig, "test:float", 10.0).Error(), check.Equals, "Property test:float can't be equal 10.000000") + c.Assert(NotEquals(fakeConfig, "test:boolean", false).Error(), check.Equals, "Property test:boolean can't be equal false") - c.Assert(Equals(fakeConfig, "test:empty", "1"), check.IsNil) - c.Assert(Equals(fakeConfig, "test:string", "testtest"), check.IsNil) - c.Assert(Equals(fakeConfig, "test:integer", 15), check.IsNil) - c.Assert(Equals(fakeConfig, "test:float", 130.0), check.IsNil) - c.Assert(Equals(fakeConfig, "test:boolean", true), check.IsNil) + c.Assert(NotEquals(fakeConfig, "test:empty", "1"), check.IsNil) + c.Assert(NotEquals(fakeConfig, "test:string", "testtest"), check.IsNil) + c.Assert(NotEquals(fakeConfig, "test:integer", 15), check.IsNil) + c.Assert(NotEquals(fakeConfig, "test:float", 130.0), check.IsNil) + c.Assert(NotEquals(fakeConfig, "test:boolean", true), check.IsNil) - c.Assert(Equals(fakeConfig, "test:boolean", true), check.IsNil) - c.Assert(Equals(fakeConfig, "test:boolean", true), check.IsNil) - c.Assert(Equals(fakeConfig, "test:boolean", true), check.IsNil) + c.Assert(NotEquals(fakeConfig, "test:boolean", true), check.IsNil) + c.Assert(NotEquals(fakeConfig, "test:boolean", true), check.IsNil) + c.Assert(NotEquals(fakeConfig, "test:boolean", true), check.IsNil) c.Assert(SetToAny(fakeConfig, "test:string", []string{"A", "B", "test"}), check.IsNil) c.Assert(SetToAny(fakeConfig, "test:string", []string{"A", "B"}).Error(), check.Equals, "Property test:string doesn't contains any valid value") @@ -202,16 +202,15 @@ func (s *ValidatorSuite) TestBasicValidators(c *check.C) { c.Assert(SetToAnyIgnoreCase(fakeConfig, "test:string", float32(1.1)), check.ErrorMatches, "Validator knf..* doesn't support input with type for checking test:string property") c.Assert(Less(fakeConfig, "test:string", float32(1.1)), check.ErrorMatches, "Validator knf..* doesn't support input with type for checking test:string property") c.Assert(Greater(fakeConfig, "test:string", float32(1.1)), check.ErrorMatches, "Validator knf..* doesn't support input with type for checking test:string property") - c.Assert(Equals(fakeConfig, "test:string", float32(1.1)), check.ErrorMatches, "Validator knf..* doesn't support input with type for checking test:string property") - c.Assert(NotLen(fakeConfig, "test:string", float32(1.1)), check.ErrorMatches, "Validator knf..* doesn't support input with type for checking test:string property") - c.Assert(NotPrefix(fakeConfig, "test:string", float32(1.1)), check.ErrorMatches, "Validator knf..* doesn't support input with type for checking test:string property") - c.Assert(NotSuffix(fakeConfig, "test:string", float32(1.1)), check.ErrorMatches, "Validator knf..* doesn't support input with type for checking test:string property") + c.Assert(NotEquals(fakeConfig, "test:string", float32(1.1)), check.ErrorMatches, "Validator knf..* doesn't support input with type for checking test:string property") + c.Assert(HasPrefix(fakeConfig, "test:string", float32(1.1)), check.ErrorMatches, "Validator knf..* doesn't support input with type for checking test:string property") + c.Assert(HasSuffix(fakeConfig, "test:string", float32(1.1)), check.ErrorMatches, "Validator knf..* doesn't support input with type for checking test:string property") c.Assert(LenLess(fakeConfig, "test:string", float32(1.1)), check.ErrorMatches, "Validator knf..* doesn't support input with type for checking test:string property") c.Assert(LenGreater(fakeConfig, "test:string", float32(1.1)), check.ErrorMatches, "Validator knf..* doesn't support input with type for checking test:string property") - c.Assert(LenNotEquals(fakeConfig, "test:string", float32(1.1)), check.ErrorMatches, "Validator knf..* doesn't support input with type for checking test:string property") + c.Assert(LenEquals(fakeConfig, "test:string", float32(1.1)), check.ErrorMatches, "Validator knf..* doesn't support input with type for checking test:string property") - c.Assert(NotPrefix(fakeConfig, "test:string", ""), check.ErrorMatches, "Validator knf..* requires non-empty input for checking test:string property") - c.Assert(NotSuffix(fakeConfig, "test:string", ""), check.ErrorMatches, "Validator knf..* requires non-empty input for checking test:string property") + c.Assert(HasPrefix(fakeConfig, "test:string", ""), check.ErrorMatches, "Validator knf..* requires non-empty input for checking test:string property") + c.Assert(HasSuffix(fakeConfig, "test:string", ""), check.ErrorMatches, "Validator knf..* requires non-empty input for checking test:string property") } func (s *ValidatorSuite) TestTypeValidators(c *check.C) { @@ -268,26 +267,6 @@ func (s *ValidatorSuite) TestTypeValidators(c *check.C) { c.Assert(TypeFloat(fakeConfig, "float:test5", nil).Error(), check.Equals, "Property float:test5 contains unsupported float value (ABCD)") } -func (s *ValidatorSuite) TestDeprecated(c *check.C) { - var err error - - configFile := createConfig(c, _CONFIG_DATA) - - err = knf.Global(configFile) - c.Assert(err, check.IsNil) - - var errs []error - - errs = knf.Validate([]*knf.Validator{ - {"boolean:test5", Empty, nil}, - {"integer:test1", NotContains, []string{"A", "B", "C"}}, - {"string:test3", NotLen, 8}, - {"string:test3", NotLen, 4}, - }) - - c.Assert(errs, check.HasLen, 3) -} - // ////////////////////////////////////////////////////////////////////////////////// // func createConfig(c *check.C, data string) string { diff --git a/knf/value/value.go b/knf/value/value.go index 7280a415..e6b79f3f 100644 --- a/knf/value/value.go +++ b/knf/value/value.go @@ -14,7 +14,7 @@ import ( "strings" "time" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/lock/lock.go b/lock/lock.go index 98d00d8c..6fa2c386 100644 --- a/lock/lock.go +++ b/lock/lock.go @@ -15,7 +15,7 @@ import ( "os" "time" - "github.com/essentialkaos/ek/v12/fsutil" + "github.com/essentialkaos/ek/v13/fsutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/log/log.go b/log/log.go index 7e113241..b1bb1d08 100644 --- a/log/log.go +++ b/log/log.go @@ -21,8 +21,8 @@ import ( "sync" "time" - "github.com/essentialkaos/ek/v12/fmtc" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/fmtc" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // @@ -765,32 +765,32 @@ func (l *Logger) writeJSONField(field Field) { // convertMinLevelValue converts any supported format of minimal level to uint8 used // for default levels func convertMinLevelValue(level any) (uint8, error) { - switch u := level.(type) { + switch t := level.(type) { case int: - return uint8(u), nil + return uint8(t), nil case int8: - return uint8(u), nil + return uint8(t), nil case int16: - return uint8(u), nil + return uint8(t), nil case int32: - return uint8(u), nil + return uint8(t), nil case int64: - return uint8(u), nil + return uint8(t), nil case uint: - return uint8(u), nil + return uint8(t), nil case uint8: - return uint8(u), nil + return uint8(t), nil case uint16: - return uint8(u), nil + return uint8(t), nil case uint32: - return uint8(u), nil + return uint8(t), nil case uint64: - return uint8(u), nil + return uint8(t), nil case string: - code, ok := logLevelsNames[strings.ToLower(level.(string))] + code, ok := logLevelsNames[strings.ToLower(t)] if !ok { - return 255, errors.New("Unknown level " + level.(string)) + return 255, errors.New("Unknown level " + t) } return code, nil diff --git a/log/log_test.go b/log/log_test.go index 13f9cb3a..0759907d 100644 --- a/log/log_test.go +++ b/log/log_test.go @@ -15,8 +15,8 @@ import ( "testing" "time" - "github.com/essentialkaos/ek/v12/fmtc" - "github.com/essentialkaos/ek/v12/fsutil" + "github.com/essentialkaos/ek/v13/fmtc" + "github.com/essentialkaos/ek/v13/fsutil" . "github.com/essentialkaos/check" ) diff --git a/netutil/netutil_linux.go b/netutil/netutil_linux.go index 1c579e91..f501e6d2 100644 --- a/netutil/netutil_linux.go +++ b/netutil/netutil_linux.go @@ -11,7 +11,7 @@ import ( "bufio" "os" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/options/arguments.go b/options/arguments.go index b54f7fe2..e0a34f73 100644 --- a/options/arguments.go +++ b/options/arguments.go @@ -12,7 +12,7 @@ import ( "strconv" "strings" - "github.com/essentialkaos/ek/v12/path" + "github.com/essentialkaos/ek/v13/path" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/passthru/passthru_spinner_test.go b/passthru/passthru_spinner_test.go index e159b726..c765ee07 100644 --- a/passthru/passthru_spinner_test.go +++ b/passthru/passthru_spinner_test.go @@ -12,12 +12,12 @@ import ( "os" "time" - "github.com/essentialkaos/ek/v12/fmtutil" - "github.com/essentialkaos/ek/v12/passthru" - "github.com/essentialkaos/ek/v12/path" - "github.com/essentialkaos/ek/v12/req" - "github.com/essentialkaos/ek/v12/spinner" - "github.com/essentialkaos/ek/v12/terminal" + "github.com/essentialkaos/ek/v13/fmtutil" + "github.com/essentialkaos/ek/v13/passthru" + "github.com/essentialkaos/ek/v13/path" + "github.com/essentialkaos/ek/v13/req" + "github.com/essentialkaos/ek/v13/spinner" + "github.com/essentialkaos/ek/v13/terminal" ) type DLSpinner struct { diff --git a/pid/pid.go b/pid/pid.go index 96891078..795a00d0 100644 --- a/pid/pid.go +++ b/pid/pid.go @@ -15,7 +15,7 @@ import ( "strconv" "strings" - "github.com/essentialkaos/ek/v12/fsutil" + "github.com/essentialkaos/ek/v13/fsutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/pid/pid_linux.go b/pid/pid_linux.go index 6c7e4da2..ff325d7f 100644 --- a/pid/pid_linux.go +++ b/pid/pid_linux.go @@ -12,7 +12,7 @@ import ( "os" "syscall" - "github.com/essentialkaos/ek/v12/fsutil" + "github.com/essentialkaos/ek/v13/fsutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/pid/pid_test.go b/pid/pid_test.go index 7d31eadb..c3260618 100644 --- a/pid/pid_test.go +++ b/pid/pid_test.go @@ -14,7 +14,7 @@ import ( . "github.com/essentialkaos/check" - "github.com/essentialkaos/ek/v12/fsutil" + "github.com/essentialkaos/ek/v13/fsutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/pluralize/pluralize.go b/pluralize/pluralize.go index 81cac8cf..e034a0b1 100644 --- a/pluralize/pluralize.go +++ b/pluralize/pluralize.go @@ -12,7 +12,7 @@ import ( "fmt" "strings" - "github.com/essentialkaos/ek/v12/mathutil" + "github.com/essentialkaos/ek/v13/mathutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/progress/examples_test.go b/progress/examples_test.go index 1f3af214..fabc2d7f 100644 --- a/progress/examples_test.go +++ b/progress/examples_test.go @@ -12,8 +12,8 @@ import ( "os" "time" - "github.com/essentialkaos/ek/v12/progress" - "github.com/essentialkaos/ek/v12/req" + "github.com/essentialkaos/ek/v13/progress" + "github.com/essentialkaos/ek/v13/req" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/progress/progress.go b/progress/progress.go index cee42bfe..2d1f49ec 100644 --- a/progress/progress.go +++ b/progress/progress.go @@ -18,10 +18,10 @@ import ( "sync/atomic" "time" - "github.com/essentialkaos/ek/v12/fmtc" - "github.com/essentialkaos/ek/v12/fmtutil" - "github.com/essentialkaos/ek/v12/mathutil" - "github.com/essentialkaos/ek/v12/passthru" + "github.com/essentialkaos/ek/v13/fmtc" + "github.com/essentialkaos/ek/v13/fmtutil" + "github.com/essentialkaos/ek/v13/mathutil" + "github.com/essentialkaos/ek/v13/passthru" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/protip/protip.go b/protip/protip.go index dcb3bf2d..8da04ed9 100644 --- a/protip/protip.go +++ b/protip/protip.go @@ -5,9 +5,9 @@ import ( "math/rand" "os" - "github.com/essentialkaos/ek/v12/fmtc" - "github.com/essentialkaos/ek/v12/fmtutil/panel" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/fmtc" + "github.com/essentialkaos/ek/v13/fmtutil/panel" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/spellcheck/spellcheck.go b/spellcheck/spellcheck.go index fd98bf9d..df483c41 100644 --- a/spellcheck/spellcheck.go +++ b/spellcheck/spellcheck.go @@ -12,7 +12,7 @@ import ( "sort" "strings" - "github.com/essentialkaos/ek/v12/mathutil" + "github.com/essentialkaos/ek/v13/mathutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/spinner/spinner.go b/spinner/spinner.go index d7d63311..86faff33 100644 --- a/spinner/spinner.go +++ b/spinner/spinner.go @@ -15,9 +15,9 @@ import ( "sync/atomic" "time" - "github.com/essentialkaos/ek/v12/fmtc" - "github.com/essentialkaos/ek/v12/strutil" - "github.com/essentialkaos/ek/v12/timeutil" + "github.com/essentialkaos/ek/v13/fmtc" + "github.com/essentialkaos/ek/v13/strutil" + "github.com/essentialkaos/ek/v13/timeutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/support/apps/apps.go b/support/apps/apps.go index 5b406d69..a8ab9545 100644 --- a/support/apps/apps.go +++ b/support/apps/apps.go @@ -15,9 +15,9 @@ import ( "os/exec" "strings" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/strutil" - "github.com/essentialkaos/ek/v12/support" + "github.com/essentialkaos/ek/v13/support" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/support/apps/apps_windows.go b/support/apps/apps_windows.go index 35ab360d..640d527e 100644 --- a/support/apps/apps_windows.go +++ b/support/apps/apps_windows.go @@ -9,7 +9,7 @@ package apps // ////////////////////////////////////////////////////////////////////////////////// // import ( - "github.com/essentialkaos/ek/v12/support" + "github.com/essentialkaos/ek/v13/support" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/support/deps/deps.go b/support/deps/deps.go index d2277845..3b10c0b0 100644 --- a/support/deps/deps.go +++ b/support/deps/deps.go @@ -9,7 +9,7 @@ package deps // ////////////////////////////////////////////////////////////////////////////////// // import ( - "github.com/essentialkaos/ek/v12/support" + "github.com/essentialkaos/ek/v13/support" "github.com/essentialkaos/depsy" ) diff --git a/support/fs/fs.go b/support/fs/fs.go index 61601a29..4bf840a7 100644 --- a/support/fs/fs.go +++ b/support/fs/fs.go @@ -12,9 +12,9 @@ package fs // ////////////////////////////////////////////////////////////////////////////////// // import ( - "github.com/essentialkaos/ek/v12/system" + "github.com/essentialkaos/ek/v13/system" - "github.com/essentialkaos/ek/v12/support" + "github.com/essentialkaos/ek/v13/support" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/support/fs/fs_windows.go b/support/fs/fs_windows.go index 384f07ab..92a294b0 100644 --- a/support/fs/fs_windows.go +++ b/support/fs/fs_windows.go @@ -9,7 +9,7 @@ package fs // ////////////////////////////////////////////////////////////////////////////////// // import ( - "github.com/essentialkaos/ek/v12/support" + "github.com/essentialkaos/ek/v13/support" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/support/network/network.go b/support/network/network.go index 5d4d0d70..54b3b5ef 100644 --- a/support/network/network.go +++ b/support/network/network.go @@ -16,13 +16,13 @@ import ( "os" "strings" - "github.com/essentialkaos/ek/v12/netutil" - "github.com/essentialkaos/ek/v12/req" - "github.com/essentialkaos/ek/v12/sliceutil" - "github.com/essentialkaos/ek/v12/sortutil" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/netutil" + "github.com/essentialkaos/ek/v13/req" + "github.com/essentialkaos/ek/v13/sliceutil" + "github.com/essentialkaos/ek/v13/sortutil" + "github.com/essentialkaos/ek/v13/strutil" - "github.com/essentialkaos/ek/v12/support" + "github.com/essentialkaos/ek/v13/support" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/support/network/network_windows.go b/support/network/network_windows.go index 9197d52b..6840d4c3 100644 --- a/support/network/network_windows.go +++ b/support/network/network_windows.go @@ -9,7 +9,7 @@ package network // ////////////////////////////////////////////////////////////////////////////////// // import ( - "github.com/essentialkaos/ek/v12/support" + "github.com/essentialkaos/ek/v13/support" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/support/pkgs/pkgs_darwin.go b/support/pkgs/pkgs_darwin.go index 60b9c410..7fadeaf8 100644 --- a/support/pkgs/pkgs_darwin.go +++ b/support/pkgs/pkgs_darwin.go @@ -8,7 +8,7 @@ package pkgs // // // ////////////////////////////////////////////////////////////////////////////////// // -import "github.com/essentialkaos/ek/v12/support" +import "github.com/essentialkaos/ek/v13/support" // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/support/pkgs/pkgs_linux.go b/support/pkgs/pkgs_linux.go index 2e9834c0..d80e9394 100644 --- a/support/pkgs/pkgs_linux.go +++ b/support/pkgs/pkgs_linux.go @@ -12,10 +12,10 @@ import ( "os/exec" "strings" - "github.com/essentialkaos/ek/v12/fsutil" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/fsutil" + "github.com/essentialkaos/ek/v13/strutil" - "github.com/essentialkaos/ek/v12/support" + "github.com/essentialkaos/ek/v13/support" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/support/pkgs/pkgs_windows.go b/support/pkgs/pkgs_windows.go index ff68a38e..cc64dbd4 100644 --- a/support/pkgs/pkgs_windows.go +++ b/support/pkgs/pkgs_windows.go @@ -9,7 +9,7 @@ package pkgs // ////////////////////////////////////////////////////////////////////////////////// // import ( - "github.com/essentialkaos/ek/v12/support" + "github.com/essentialkaos/ek/v13/support" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/support/services/services.go b/support/services/services.go index 21a5a46d..3066df9e 100644 --- a/support/services/services.go +++ b/support/services/services.go @@ -12,8 +12,8 @@ package services // ////////////////////////////////////////////////////////////////////////////////// // import ( - "github.com/essentialkaos/ek/v12/initsystem" - "github.com/essentialkaos/ek/v12/support" + "github.com/essentialkaos/ek/v13/initsystem" + "github.com/essentialkaos/ek/v13/support" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/support/services/services_windows.go b/support/services/services_windows.go index 385ae76b..ea68cfd0 100644 --- a/support/services/services_windows.go +++ b/support/services/services_windows.go @@ -8,7 +8,7 @@ package services // // // ////////////////////////////////////////////////////////////////////////////////// // -import "github.com/essentialkaos/ek/v12/support" +import "github.com/essentialkaos/ek/v13/support" // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/support/support_darwin.go b/support/support_darwin.go index 011b45d3..f734cd6a 100644 --- a/support/support_darwin.go +++ b/support/support_darwin.go @@ -7,7 +7,7 @@ package support // // // ////////////////////////////////////////////////////////////////////////////////// // -import "github.com/essentialkaos/ek/v12/system" +import "github.com/essentialkaos/ek/v13/system" // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/support/support_linux.go b/support/support_linux.go index 306e4df4..10b5884b 100644 --- a/support/support_linux.go +++ b/support/support_linux.go @@ -8,8 +8,8 @@ package support // ////////////////////////////////////////////////////////////////////////////////// // import ( - "github.com/essentialkaos/ek/v12/system" - "github.com/essentialkaos/ek/v12/system/container" + "github.com/essentialkaos/ek/v13/system" + "github.com/essentialkaos/ek/v13/system/container" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/support/support_nix.go b/support/support_nix.go index d4d0415f..f97ae451 100644 --- a/support/support_nix.go +++ b/support/support_nix.go @@ -17,12 +17,12 @@ import ( "runtime/debug" "strings" - "github.com/essentialkaos/ek/v12/fmtc" - "github.com/essentialkaos/ek/v12/fmtutil" - "github.com/essentialkaos/ek/v12/hash" - "github.com/essentialkaos/ek/v12/mathutil" - "github.com/essentialkaos/ek/v12/path" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/fmtc" + "github.com/essentialkaos/ek/v13/fmtutil" + "github.com/essentialkaos/ek/v13/hash" + "github.com/essentialkaos/ek/v13/mathutil" + "github.com/essentialkaos/ek/v13/path" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/support/support_test.go b/support/support_test.go index c7c19312..07956dc7 100644 --- a/support/support_test.go +++ b/support/support_test.go @@ -11,7 +11,7 @@ import ( "os" "testing" - "github.com/essentialkaos/ek/v12/fmtc" + "github.com/essentialkaos/ek/v13/fmtc" . "github.com/essentialkaos/check" ) @@ -28,7 +28,7 @@ var _ = Suite(&SupportSuite{}) // ////////////////////////////////////////////////////////////////////////////////// // -var gomodData = []byte(`module github.com/essentialkaos/ek/v12 +var gomodData = []byte(`module github.com/essentialkaos/ek/v13 go 1.18 diff --git a/system/info_cpu_linux.go b/system/info_cpu_linux.go index b93a6760..db6cb881 100644 --- a/system/info_cpu_linux.go +++ b/system/info_cpu_linux.go @@ -15,7 +15,7 @@ import ( "strings" "time" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/system/info_darwin.go b/system/info_darwin.go index c96bd59f..eaa92caf 100644 --- a/system/info_darwin.go +++ b/system/info_darwin.go @@ -14,7 +14,7 @@ import ( "strings" "syscall" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/system/info_fs_linux.go b/system/info_fs_linux.go index 2e1ff9c2..5eadc638 100644 --- a/system/info_fs_linux.go +++ b/system/info_fs_linux.go @@ -15,7 +15,7 @@ import ( "syscall" "time" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/system/info_linux.go b/system/info_linux.go index e156b8ed..90d188a1 100644 --- a/system/info_linux.go +++ b/system/info_linux.go @@ -15,8 +15,8 @@ import ( "strings" "syscall" - "github.com/essentialkaos/ek/v12/strutil" - "github.com/essentialkaos/ek/v12/system/container" + "github.com/essentialkaos/ek/v13/strutil" + "github.com/essentialkaos/ek/v13/system/container" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/system/info_loadavg_linux.go b/system/info_loadavg_linux.go index b88c7310..4976e37e 100644 --- a/system/info_loadavg_linux.go +++ b/system/info_loadavg_linux.go @@ -15,7 +15,7 @@ import ( "strconv" "strings" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/system/info_memory_linux.go b/system/info_memory_linux.go index 6c1607d4..b2594225 100644 --- a/system/info_memory_linux.go +++ b/system/info_memory_linux.go @@ -11,7 +11,7 @@ import ( "bufio" "errors" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/system/info_net_linux.go b/system/info_net_linux.go index 8ea4cd4d..632fe8ca 100644 --- a/system/info_net_linux.go +++ b/system/info_net_linux.go @@ -14,7 +14,7 @@ import ( "strings" "time" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/system/process/process_cpu.go b/system/process/process_cpu.go index fa381320..18ab05ab 100644 --- a/system/process/process_cpu.go +++ b/system/process/process_cpu.go @@ -18,7 +18,7 @@ import ( "strconv" "time" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/system/process/process_memory.go b/system/process/process_memory.go index 7072f0eb..02a9b1e5 100644 --- a/system/process/process_memory.go +++ b/system/process/process_memory.go @@ -16,7 +16,7 @@ import ( "os" "strconv" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/system/process/process_mount.go b/system/process/process_mount.go index c3219182..38dac93e 100644 --- a/system/process/process_mount.go +++ b/system/process/process_mount.go @@ -17,7 +17,7 @@ import ( "strconv" "strings" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/system/process/process_nice.go b/system/process/process_nice.go index 4ad6c0b3..2e212ed2 100644 --- a/system/process/process_nice.go +++ b/system/process/process_nice.go @@ -13,7 +13,7 @@ package process import ( "syscall" - "github.com/essentialkaos/ek/v12/mathutil" + "github.com/essentialkaos/ek/v13/mathutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/system/process/processes_linux.go b/system/process/processes_linux.go index 38bcb58d..b5d8fde4 100644 --- a/system/process/processes_linux.go +++ b/system/process/processes_linux.go @@ -17,8 +17,8 @@ import ( "strconv" "strings" - "github.com/essentialkaos/ek/v12/fsutil" - "github.com/essentialkaos/ek/v12/system" + "github.com/essentialkaos/ek/v13/fsutil" + "github.com/essentialkaos/ek/v13/system" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/system/sensors/sensors_linux.go b/system/sensors/sensors_linux.go index feab69ee..1e512530 100644 --- a/system/sensors/sensors_linux.go +++ b/system/sensors/sensors_linux.go @@ -17,8 +17,8 @@ import ( "strconv" "strings" - "github.com/essentialkaos/ek/v12/fsutil" - "github.com/essentialkaos/ek/v12/sortutil" + "github.com/essentialkaos/ek/v13/fsutil" + "github.com/essentialkaos/ek/v13/sortutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/system/user.go b/system/user.go index 1a81cfad..31f7387b 100644 --- a/system/user.go +++ b/system/user.go @@ -20,8 +20,8 @@ import ( "syscall" "time" - "github.com/essentialkaos/ek/v12/env" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/env" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/system/user_darwin.go b/system/user_darwin.go index 9ea77c15..dce8b2ab 100644 --- a/system/user_darwin.go +++ b/system/user_darwin.go @@ -14,7 +14,7 @@ import ( "strconv" "strings" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/system/user_unix.go b/system/user_unix.go index f1c7ada8..c71e901b 100644 --- a/system/user_unix.go +++ b/system/user_unix.go @@ -16,7 +16,7 @@ import ( "strconv" "strings" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/terminal/input/input.go b/terminal/input/input.go index 0aa078a7..c13916aa 100644 --- a/terminal/input/input.go +++ b/terminal/input/input.go @@ -17,12 +17,12 @@ import ( "strings" "unicode/utf8" - "github.com/essentialkaos/ek/v12/ansi" - "github.com/essentialkaos/ek/v12/fmtc" - "github.com/essentialkaos/ek/v12/mathutil" - "github.com/essentialkaos/ek/v12/secstr" - "github.com/essentialkaos/ek/v12/terminal" - "github.com/essentialkaos/ek/v12/terminal/tty" + "github.com/essentialkaos/ek/v13/ansi" + "github.com/essentialkaos/ek/v13/fmtc" + "github.com/essentialkaos/ek/v13/mathutil" + "github.com/essentialkaos/ek/v13/secstr" + "github.com/essentialkaos/ek/v13/terminal" + "github.com/essentialkaos/ek/v13/terminal/tty" linenoise "github.com/essentialkaos/go-linenoise/v3" ) diff --git a/terminal/input/input_windows.go b/terminal/input/input_windows.go index fe96e660..eceb46d0 100644 --- a/terminal/input/input_windows.go +++ b/terminal/input/input_windows.go @@ -11,7 +11,7 @@ package input import ( "errors" - "github.com/essentialkaos/ek/v12/secstr" + "github.com/essentialkaos/ek/v13/secstr" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/terminal/terminal.go b/terminal/terminal.go index 7c288354..f2e1e785 100644 --- a/terminal/terminal.go +++ b/terminal/terminal.go @@ -13,8 +13,8 @@ import ( "os" "strings" - "github.com/essentialkaos/ek/v12/fmtc" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/fmtc" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/terminal/tty/tmux_linux.go b/terminal/tty/tmux_linux.go index 3344b95b..413b28ca 100644 --- a/terminal/tty/tmux_linux.go +++ b/terminal/tty/tmux_linux.go @@ -16,7 +16,7 @@ import ( "strconv" "strings" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/timeutil/timeutil.go b/timeutil/timeutil.go index 334c4ce5..fc70af20 100644 --- a/timeutil/timeutil.go +++ b/timeutil/timeutil.go @@ -16,8 +16,8 @@ import ( "strings" "time" - "github.com/essentialkaos/ek/v12/mathutil" - "github.com/essentialkaos/ek/v12/pluralize" + "github.com/essentialkaos/ek/v13/mathutil" + "github.com/essentialkaos/ek/v13/pluralize" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/tmp/tmp.go b/tmp/tmp.go index d6df2f1e..335f3ace 100644 --- a/tmp/tmp.go +++ b/tmp/tmp.go @@ -14,9 +14,9 @@ import ( "path/filepath" "time" - "github.com/essentialkaos/ek/v12/fsutil" - "github.com/essentialkaos/ek/v12/rand" - "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v13/fsutil" + "github.com/essentialkaos/ek/v13/rand" + "github.com/essentialkaos/ek/v13/strutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/tmp/tmp_test.go b/tmp/tmp_test.go index 6447e639..718c7bc5 100644 --- a/tmp/tmp_test.go +++ b/tmp/tmp_test.go @@ -14,7 +14,7 @@ import ( . "github.com/essentialkaos/check" - "github.com/essentialkaos/ek/v12/fsutil" + "github.com/essentialkaos/ek/v13/fsutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/usage/completion/bash/bash.go b/usage/completion/bash/bash.go index d1caad5d..76ddbdeb 100644 --- a/usage/completion/bash/bash.go +++ b/usage/completion/bash/bash.go @@ -12,7 +12,7 @@ import ( "fmt" "strings" - "github.com/essentialkaos/ek/v12/usage" + "github.com/essentialkaos/ek/v13/usage" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/usage/completion/bash/bash_test.go b/usage/completion/bash/bash_test.go index c30f36dc..d4cb8338 100644 --- a/usage/completion/bash/bash_test.go +++ b/usage/completion/bash/bash_test.go @@ -10,7 +10,7 @@ package bash import ( "testing" - "github.com/essentialkaos/ek/v12/usage" + "github.com/essentialkaos/ek/v13/usage" . "github.com/essentialkaos/check" ) diff --git a/usage/completion/bash/examples_test.go b/usage/completion/bash/examples_test.go index 3e512a3e..e1bd4812 100644 --- a/usage/completion/bash/examples_test.go +++ b/usage/completion/bash/examples_test.go @@ -10,7 +10,7 @@ package bash import ( "fmt" - "github.com/essentialkaos/ek/v12/usage" + "github.com/essentialkaos/ek/v13/usage" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/usage/completion/fish/examples_test.go b/usage/completion/fish/examples_test.go index f7a03774..a40f83d4 100644 --- a/usage/completion/fish/examples_test.go +++ b/usage/completion/fish/examples_test.go @@ -10,7 +10,7 @@ package fish import ( "fmt" - "github.com/essentialkaos/ek/v12/usage" + "github.com/essentialkaos/ek/v13/usage" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/usage/completion/fish/fish.go b/usage/completion/fish/fish.go index bc0c40bc..11fff113 100644 --- a/usage/completion/fish/fish.go +++ b/usage/completion/fish/fish.go @@ -12,8 +12,8 @@ import ( "fmt" "strings" - "github.com/essentialkaos/ek/v12/fmtc" - "github.com/essentialkaos/ek/v12/usage" + "github.com/essentialkaos/ek/v13/fmtc" + "github.com/essentialkaos/ek/v13/usage" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/usage/completion/fish/fish_test.go b/usage/completion/fish/fish_test.go index 36d556a0..b6d42589 100644 --- a/usage/completion/fish/fish_test.go +++ b/usage/completion/fish/fish_test.go @@ -10,7 +10,7 @@ package fish import ( "testing" - "github.com/essentialkaos/ek/v12/usage" + "github.com/essentialkaos/ek/v13/usage" . "github.com/essentialkaos/check" ) diff --git a/usage/completion/zsh/examples_test.go b/usage/completion/zsh/examples_test.go index e7f109cb..c2e7eed7 100644 --- a/usage/completion/zsh/examples_test.go +++ b/usage/completion/zsh/examples_test.go @@ -10,8 +10,8 @@ package zsh import ( "fmt" - "github.com/essentialkaos/ek/v12/options" - "github.com/essentialkaos/ek/v12/usage" + "github.com/essentialkaos/ek/v13/options" + "github.com/essentialkaos/ek/v13/usage" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/usage/completion/zsh/zsh.go b/usage/completion/zsh/zsh.go index 64e0f9de..bcbbd688 100644 --- a/usage/completion/zsh/zsh.go +++ b/usage/completion/zsh/zsh.go @@ -12,9 +12,9 @@ import ( "fmt" "strings" - "github.com/essentialkaos/ek/v12/fmtc" - "github.com/essentialkaos/ek/v12/options" - "github.com/essentialkaos/ek/v12/usage" + "github.com/essentialkaos/ek/v13/fmtc" + "github.com/essentialkaos/ek/v13/options" + "github.com/essentialkaos/ek/v13/usage" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/usage/completion/zsh/zsh_test.go b/usage/completion/zsh/zsh_test.go index 5a263978..de0a6dea 100644 --- a/usage/completion/zsh/zsh_test.go +++ b/usage/completion/zsh/zsh_test.go @@ -10,8 +10,8 @@ package zsh import ( "testing" - "github.com/essentialkaos/ek/v12/options" - "github.com/essentialkaos/ek/v12/usage" + "github.com/essentialkaos/ek/v13/options" + "github.com/essentialkaos/ek/v13/usage" . "github.com/essentialkaos/check" ) diff --git a/usage/man/man.go b/usage/man/man.go index 292805aa..911c839c 100644 --- a/usage/man/man.go +++ b/usage/man/man.go @@ -13,9 +13,9 @@ import ( "strings" "time" - "github.com/essentialkaos/ek/v12/fmtc" - "github.com/essentialkaos/ek/v12/timeutil" - "github.com/essentialkaos/ek/v12/usage" + "github.com/essentialkaos/ek/v13/fmtc" + "github.com/essentialkaos/ek/v13/timeutil" + "github.com/essentialkaos/ek/v13/usage" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/usage/man/man_test.go b/usage/man/man_test.go index 557a58ee..7106ca18 100644 --- a/usage/man/man_test.go +++ b/usage/man/man_test.go @@ -12,8 +12,8 @@ import ( "testing" "time" - "github.com/essentialkaos/ek/v12/timeutil" - "github.com/essentialkaos/ek/v12/usage" + "github.com/essentialkaos/ek/v13/timeutil" + "github.com/essentialkaos/ek/v13/usage" . "github.com/essentialkaos/check" ) diff --git a/usage/update/github.go b/usage/update/github.go index baaefe22..3748a4e8 100644 --- a/usage/update/github.go +++ b/usage/update/github.go @@ -11,7 +11,7 @@ import ( "strings" "time" - "github.com/essentialkaos/ek/v12/req" + "github.com/essentialkaos/ek/v13/req" ) // ////////////////////////////////////////////////////////////////////////////////// // @@ -50,7 +50,7 @@ func getLatestGitHubRelease(app, version, repository string) *githubRelease { engine.SetDialTimeout(3) engine.SetRequestTimeout(3) - engine.SetUserAgent(app, version, "GoEK.v12") + engine.SetUserAgent(app, version, "GoEK.v13") response, err := engine.Get(req.Request{ URL: githubAPI + "/repos/" + repository + "/releases/latest", diff --git a/usage/update/gitlab.go b/usage/update/gitlab.go index fc2c5e09..47018730 100644 --- a/usage/update/gitlab.go +++ b/usage/update/gitlab.go @@ -11,7 +11,7 @@ import ( "strings" "time" - "github.com/essentialkaos/ek/v12/req" + "github.com/essentialkaos/ek/v13/req" ) // ////////////////////////////////////////////////////////////////////////////////// // @@ -50,7 +50,7 @@ func getLatestGitLabRelease(app, version, repository string) *gitlabRelease { engine.SetDialTimeout(3) engine.SetRequestTimeout(3) - engine.SetUserAgent(app, version, "GoEK.v12") + engine.SetUserAgent(app, version, "GoEK.v13") if strings.Contains(repository, "/") { repository = strings.ReplaceAll(repository, "/", "%2F") diff --git a/usage/update/update.go b/usage/update/update.go index bff3fea9..3b43111b 100644 --- a/usage/update/update.go +++ b/usage/update/update.go @@ -11,7 +11,7 @@ import ( "os" "time" - "github.com/essentialkaos/ek/v12/req" + "github.com/essentialkaos/ek/v13/req" ) // ////////////////////////////////////////////////////////////////////////////////// // @@ -47,7 +47,7 @@ func getLastReleaseInfo(app, version, storage string) *ReleaseInfo { engine.SetDialTimeout(3) engine.SetRequestTimeout(3) - engine.SetUserAgent(app, version, "GoEK.v12") + engine.SetUserAgent(app, version, "GoEK.v13") response, err := engine.Get(req.Request{ URL: storage + "/latest.json", diff --git a/usage/usage.go b/usage/usage.go index c24cbd57..4d46196e 100644 --- a/usage/usage.go +++ b/usage/usage.go @@ -17,10 +17,10 @@ import ( "strings" "time" - "github.com/essentialkaos/ek/v12/fmtc" - "github.com/essentialkaos/ek/v12/mathutil" - "github.com/essentialkaos/ek/v12/strutil" - "github.com/essentialkaos/ek/v12/version" + "github.com/essentialkaos/ek/v13/fmtc" + "github.com/essentialkaos/ek/v13/mathutil" + "github.com/essentialkaos/ek/v13/strutil" + "github.com/essentialkaos/ek/v13/version" ) // ////////////////////////////////////////////////////////////////////////////////// //