Error messages don't include any contextual information by default. If
the path to a Go file is in there, it's because whatever created the
error message (or modified it at some point) put it there. Where is
that error created, and what touches it as it flows through the call
stack to the logging statement that prints it to the screen? Don't
forget to also check the logging package itself, which can sometimes
annotate with caller information. Trace that out, and you'll find your
answer.
On Tue, Oct 16, 2018 at 11:28 AM Rich <rma...@gmail.com> wrote:
>
> I apologize if this has been asked before but I searched google and this 
> group and didn't find it.  How do you remove the path from the error 
> messages?  So I have a valid error:
>
> 2018/10/16 18:13:12 [error] in 
> main.checkMaster[/Users/rich/go/mysqlrun/mysqlrun.go:739] Error 1045: Access 
> denied for user
>
> How do I get rid of the part highlighted above? It's a valid error. The user 
> specified the wrong password so I want the error -- I just don't want the 
> path part as a part of that error.  This happens any time there is an error 
> in a script, it prints out information about the author that I don't 
> particularly want published.
>
> Thanks
>
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to