You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently error text is rendered as a single styled block (title-cased first word + ErrorText style).
It would be useful to allow inline styling within error messages e.g. colorising flags (--thing) or env vars (ENV_VAR) differently from the surrounding text.
Today the only way to achieve this is embedding raw ANSI codes in the error string or bypassing fang's error rendering entirely, both of which are hacky.
A simple API like fang.Highlight("--thing") that returns a string passable into errors.New / fmt.Errorf would cover most cases.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Currently error text is rendered as a single styled block (title-cased first word + ErrorText style).
It would be useful to allow inline styling within error messages e.g. colorising flags (
--thing) or env vars (ENV_VAR) differently from the surrounding text.Today the only way to achieve this is embedding raw ANSI codes in the error string or bypassing fang's error rendering entirely, both of which are hacky.
A simple API like
fang.Highlight("--thing")that returns a string passable into errors.New / fmt.Errorf would cover most cases.Beta Was this translation helpful? Give feedback.
All reactions