Good ideas, I added explanations for the 
shorthands: 
https://github.com/egonk/sc/commit/257d48f5ba187082ffb6a9b8b9d326eca26cb787

W or Wrap comes from the classic errors.Wrap (https://github.com/pkg/errors)

Long forms might be added in a different package in the future (like 
github.com/egonk/sc/long/sc) because short form is specifically designed to 
work with dot imports. I am not sure if having two different names for 
everything is a good idea though, it could be even more confusing? I don't 
plan to add any extra functions to the package so learning these 9 should 
be enough for the foreseeable future. Unless some extremely useful func 
comes up of course :)

On Tuesday, January 25, 2022 at 10:40:24 PM UTC+1 corin....@gmail.com wrote:

>
> For my money, as a newcomer to the API, having both the long named 
> function and the shorthand would be useful.  I can see myself using M 
> immediately, but some like W I'm not likely to remember as readily and 
> longer names would help in adopting the library.  (Also, what is the 
> mnemonic for W?)  Afterall, commands in vi have a long form and short forms.
> On Monday, 24 January 2022 at 10:32:48 pm UTC+11 eko...@gmail.com wrote:
>
>> sc is a convenience package to support writing short automation scripts 
>> that simply panic on errors. It is similar to shell scripting with "set -e" 
>> option.
>>
>> https://pkg.go.dev/github.com/egonk/sc
>>
>> I wrote the package to stop copy pasting trivial helpers in throwaway and 
>> build automation scripts. Obviously panics instead of errors are not 
>> recommended for Go code, but I saw no big benefits by writing elaborate 
>> error messages in such scripts.
>>
>> M (generic Must) does not show on pkg.go.dev, probably because generics 
>> are not yet enabled. P (Printf) and PE (Fprintf os.Stderr) are currently 
>> not detected by go vet as printf funcs, is there a way to mark them in the 
>> package as printf?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/9adff0f8-d9ac-4437-ac93-6eb377f6779en%40googlegroups.com.

Reply via email to