Re: [go-nuts] x/text: Interest in Unicode text segmentation?

2020-04-16 Thread mpvl
Most of the x/text packages use tries and not rangetables. These allow arbitrary data (as long as it fits in an int) to be associated with runes and allow operating on utf8 without having to convert to tunes. https://godoc.org/golang.org/x/text/internal/triegen. But that’s not a requirement. The

Re: [go-nuts] DeepCloning a datastructure

2020-04-16 Thread Hugh Emberson
And, I realized just after posting that your data structure has private fields in it as https://github.com/mohae/deepcopy won't work on those. On Thu, Apr 16, 2020 at 9:02 PM Hugh Emberson wrote: > On Thu, Apr 16, 2020 at 2:07 PM Marc Schöchlin wrote: > >> i am searching for a convenient way

Re: [go-nuts] How can I syslog without PID

2020-04-16 Thread Ian Lance Taylor
On Thu, Apr 16, 2020 at 8:16 PM Dean Schulze wrote: > > I have a C program with a syslog command like this: > > syslog(LOG_INFO, "slurmctrld: initializing resources"); > > It outputs the first line below in the syslog. This C code executes a golang > binary that also does syslog commands: > >

Re: [go-nuts] How can I syslog without PID

2020-04-16 Thread Dan Kortschak
You can get the PID with https://golang.org/pkg/os/#Getpid and use that you construct a string to hand in as tag to syslog.New. On Thu, 2020-04-16 at 20:16 -0700, Dean Schulze wrote: > I have a C program with a syslog command like this: > > syslog(LOG_INFO, "slurmctrld: initializing resources");

Re: [go-nuts] DeepCloning a datastructure

2020-04-16 Thread Hugh Emberson
On Thu, Apr 16, 2020 at 2:07 PM Marc Schöchlin wrote: > i am searching for a convenient way to deep-clone a nested datastructure. > I've used https://github.com/mohae/deepcopy with some success. YMMV. Regards, Hugh -- You received this message because you are subscribed to the Google Groups

[go-nuts] How can I syslog without PID

2020-04-16 Thread Dean Schulze
I have a C program with a syslog command like this: syslog(LOG_INFO, "slurmctrld: initializing resources"); It outputs the first line below in the syslog. This C code executes a golang binary that also does syslog commands: Syslogger, err = syslog.New(syslog.LOG_INFO, "slurmctld")

[go-nuts] DeepCloning a datastructure

2020-04-16 Thread Marc Schöchlin
Hello List, i am searching for a convenient way to deep-clone a nested datastructure. My data structure looks like this: (map[string]map[string]*processing.AccountingSet) (len=1) {  (string) (len=16) "foo1.bar.com:443": (map[string]*processing.AccountingSet) (len=1) {   (string) (len=3) "all":

Re: [go-nuts] x/text: Interest in Unicode text segmentation?

2020-04-16 Thread Matt Sherman
Great. Yes, the data files are here: https://unicode.org/reports/tr41/tr41-26.html#Props0 I’ve done a proof of concept here: https://github.com/clipperhouse/uax29 To do it properly, I assume we’d want to use the house style here?

Re: [go-nuts] x/text: Interest in Unicode text segmentation?

2020-04-16 Thread mpvl
Yes that would be interesting. Especially if it can be generated from the Unicode raw data upon updates. On Wed, 15 Apr 2020 at 23:56 Ian Lance Taylor wrote: > [ +mpvl ] > > On Wed, Apr 15, 2020 at 2:30 PM Matt Sherman wrote: > > > > Hi, I am working on a tokenizer based on Unicode text

Re: [go-nuts] Re: "Go build failed." in Go tour requires explicit Kill

2020-04-16 Thread Marvin Renich
* Brian Candler [200416 12:20]: > I've noticed this too. This is with the tour, rather than play.golang.org. > > To reproduce (I'm using Chrome 80 under macOS 10.14): > > * Go to a tour page which doesn't compile, e.g. > https://tour.golang.org/methods/25 > * Click Run > * At this point it

[go-nuts] Re: "Go build failed." in Go tour requires explicit Kill

2020-04-16 Thread Jake Montgomery
On Wednesday, April 15, 2020 at 1:02:47 PM UTC-4, Marvin Renich wrote: > > In the Go tour, what is the purpose of requiring the user to explicitly > press the "Kill" button when the build fails? This seems completely > unnecessary to me. > > If this is just a natural consequence of the

Re: [go-nuts] Re: wording in Go tour, methods/19

2020-04-16 Thread Marvin Renich
* Volker Dobler [200416 02:28]: > On Wednesday, 15 April 2020 17:58:11 UTC+2, Marvin Renich wrote: > > > > In the Go tour at https://tour.golang.org/methods/19 it says > > > > The error type is a built-in interface similar to fmt.Stringer: > > I agree that this might be misunderstood in the

[go-nuts] Re: How to scan input with termui?

2020-04-16 Thread Brian Candler
inputParagraph.Text = fmt.Scanf("%s", input) // Error: assignment mismatch: 1 variable but fmt.Scanf returns 2 values The error message is clear: fmt.Scanf returns two values (BTW, neither of them is the value extracted). Check the documentation for fmt.Scanf here:

[go-nuts] How to scan input with termui?

2020-04-16 Thread 洪嘉鴻
Hello everyone: I use golang with Win10. I started to learn termui recently. However, I couldn't find any examples about how to scan input with this . I tried to write simple code , but there are some

[go-nuts] Re: wording in Go tour, methods/19

2020-04-16 Thread Volker Dobler
On Wednesday, 15 April 2020 17:58:11 UTC+2, Marvin Renich wrote: > > In the Go tour at https://tour.golang.org/methods/19 it says > > The error type is a built-in interface similar to fmt.Stringer: > > The words closest to "similar to" are "built-in interface", implying > that the way error