From ba7a9fd2c9d5ddd106407c9e1fa7337e8ad7e3b9 Mon Sep 17 00:00:00 2001 From: guonaihong Date: Sun, 26 May 2024 15:02:35 +0800 Subject: [PATCH] add URL URI --- env_short_long_name.go | 3 ++- env_short_long_name_test.go | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/env_short_long_name.go b/env_short_long_name.go index 35539c0..22703e5 100644 --- a/env_short_long_name.go +++ b/env_short_long_name.go @@ -12,7 +12,8 @@ var specialNames = map[string]bool{ "JSON": true, "XML": true, "YAML": true, - // Add more special names here + "URL": true, + "URI": true, } func wordStart(b byte) bool { diff --git a/env_short_long_name_test.go b/env_short_long_name_test.go index c1b583f..edfaec1 100644 --- a/env_short_long_name_test.go +++ b/env_short_long_name_test.go @@ -19,6 +19,8 @@ func Test_ShortLongName(t *testing.T) { {"_almost_all", "almost-all"}, {"LongOpt_all", "long-opt-all"}, {"JSON", "JSON"}, + {"URL", "URL"}, + {"URI", "URI"}, } { got, err := gnuOptionName(tcase.in) assert.NoError(t, err) @@ -34,6 +36,8 @@ func Test_EnvName(t *testing.T) { {"_almost_all", "ALMOST_ALL"}, {"envOpt_all", "ENV_OPT_ALL"}, {"JSON", "JSON"}, + {"URL", "URL"}, + {"URI", "URI"}, } { got, err := envOptionName(tcase.in) assert.NoError(t, err)