Re: [go-nuts] Add to existing Go Package

2022-01-17 Thread Richard Masci
OK Thanks!!

On Mon, Jan 17, 2022 at 1:03 PM Axel Wagner 
wrote:

> On Mon, Jan 17, 2022 at 6:57 PM Rich  wrote:
>
>> What I am worried about is that my version of log will diverge from the
>> Go standard log package.   Is there a way to extend an existing package so
>> that my adds to the log package pulls from whatever happens to be the most
>> current version of log?
>>
>
> No. You can only either a) build something on top of it (i.e. a wrapper),
> or b) copy the package with your own modifications and distribute that.
>
>
>> --
>> 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/60ae5b79-b1b9-451d-b8bb-d3726f22ab71n%40googlegroups.com
>> 
>> .
>>
>

-- 
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/CAJ0CmuFutv6nusSSaybw8DfSHpiiM-WU%2BdFDSvfXU94uVrvc1w%40mail.gmail.com.


Re: [go-nuts] Add to existing Go Package

2022-01-17 Thread 'Axel Wagner' via golang-nuts
On Mon, Jan 17, 2022 at 6:57 PM Rich  wrote:

> What I am worried about is that my version of log will diverge from the Go
> standard log package.   Is there a way to extend an existing package so
> that my adds to the log package pulls from whatever happens to be the most
> current version of log?
>

No. You can only either a) build something on top of it (i.e. a wrapper),
or b) copy the package with your own modifications and distribute that.


> --
> 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/60ae5b79-b1b9-451d-b8bb-d3726f22ab71n%40googlegroups.com
> 
> .
>

-- 
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/CAEkBMfHR_g1u4JyyYj2153YdF_m7E0oP71Biha623941yMadAA%40mail.gmail.com.


[go-nuts] Add to existing Go Package

2022-01-17 Thread Rich
What I want to do is extend the go standard log package. I am using log to 
write logfiles, but there are two things with it I need to extend. 

The first is a 'Format' string, which allows me to change the time format 
string log uses.

The second is to be able to print to both logfile and stdout., This is 
useful when you're starting your server, and you want some of the output to 
go directly to stdout. I use this so that with one line I can print the 
same line to stdout as I print to my log file.

lgOut.Tprintf("Server Version: %s Started and listens on:  %s:%s, ", 
server.Version, server.Address, server.Port)

That would print to both stdout and to the logfile lgOut is configured for.
Ex: 
20220117-13:45 | Server Version 1.0.1 Started and listens on 127.0.0.1:8080"
 
What I am worried about is that my version of log will diverge from the Go 
standard log package.   Is there a way to extend an existing package so 
that my adds to the log package pulls from whatever happens to be the most 
current version of log?

-- 
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/60ae5b79-b1b9-451d-b8bb-d3726f22ab71n%40googlegroups.com.