mirror of
https://github.com/aykhans/sarin.git
synced 2026-02-28 06:49:13 +00:00
Rename Append to Merge, replace strings_Join with slice_Join, and auto-detect non-TTY output
- Rename Append to Merge on Cookies, Headers, and Params types and simplify Parse to use direct append - Replace strings_Join(sep, ...values) with slice_Join(slice, sep) for consistency with slice-based template functions - Auto-enable quiet mode when stdout is not a terminal - Remove ErrCLINoArgs check to allow running sarin without arguments - Add -it flag to Docker examples in docs
This commit is contained in:
@@ -62,10 +62,6 @@ func NewDefaultTemplateFuncMap(randSource rand.Source, fileCache *FileCache) tem
|
||||
},
|
||||
"strings_TrimPrefix": strings.TrimPrefix,
|
||||
"strings_TrimSuffix": strings.TrimSuffix,
|
||||
"strings_Join": func(sep string, values ...string) string {
|
||||
return strings.Join(values, sep)
|
||||
},
|
||||
|
||||
// Dict
|
||||
"dict_Str": func(values ...string) map[string]string {
|
||||
dict := make(map[string]string)
|
||||
@@ -83,6 +79,7 @@ func NewDefaultTemplateFuncMap(randSource rand.Source, fileCache *FileCache) tem
|
||||
"slice_Str": func(values ...string) []string { return values },
|
||||
"slice_Int": func(values ...int) []int { return values },
|
||||
"slice_Uint": func(values ...uint) []uint { return values },
|
||||
"slice_Join": strings.Join,
|
||||
|
||||
// File
|
||||
// file_Base64 reads a file (local or remote URL) and returns its Base64 encoded content.
|
||||
|
||||
Reference in New Issue
Block a user