In a gh extension (written in bash) I needed to implement a fuzzy matching on the content of a label. Specifically I needed to exclude issues which has a label with project: prefix. However, I couldn't find any functions in https://github.com/cli/go-gh/blob/trunk/pkg/template/template.go or standard go templates to support startsWith.
There are quite a few string related function in https://github.com/Masterminds/sprig including the function which would help in my case:
- contains
- hasPrefix
- hasSuffix
- regexMatch
If inclusion of sprig into go-gh is not an option, would it be possible to implement at least contains in the pkg/template/template.go?
In a
ghextension (written in bash) I needed to implement a fuzzy matching on the content of a label. Specifically I needed to exclude issues which has a label withproject:prefix. However, I couldn't find any functions in https://github.com/cli/go-gh/blob/trunk/pkg/template/template.go or standard go templates to supportstartsWith.There are quite a few string related function in https://github.com/Masterminds/sprig including the function which would help in my case:
If inclusion of sprig into go-gh is not an option, would it be possible to implement at least
containsin thepkg/template/template.go?