[go-nuts] Re: Why causes []any trouble in type equations?

2023-10-12 Thread Torsten Bronger
Hallöchen! Patrick Smith writes: > [...] > > Here F is a simple, non-generic function, with no type > parameters. It cannot be instantiated. Any attempt to explain what > this code would do if it were legal (which it should not be) > should not involve generics, type parameters, or instantiation.

[go-nuts] bufio.Scanner - possible bug or doc err?

2023-10-12 Thread 'Mark' via golang-nuts
I'm reading Debian *Package files, some of which are over 1M lines long. I used bufio.Scanner and found that it won't read past 1M lines (I'm using Go 1.21.1 linux/amd64). Is this a limitation of bufio.Scanner? If so then it ought to be in the docs. Or is it a bug? Or maybe I made a mistake (alth

Re: [go-nuts] bufio.Scanner - possible bug or doc err?

2023-10-12 Thread Rob Pike
I just did a simple test with a 2M line file and it worked fine, so I suspect it's a bug in your code. But if not, please provide a complete working executable example, with data, to help identify the problem. -rob On Thu, Oct 12, 2023 at 7:39 PM 'Mark' via golang-nuts < golang-nuts@googlegroups

[go-nuts] Question about runtime.Pinner

2023-10-12 Thread Pascal Costanza
Hi, I have a question about runtime.Pinner: The documentation states that you can only pin an object when it’s the result of calling new, taking the address of a composite literal, or taking the address of a local variable. At the same time, the Go language specification states that a slice cr

Re: [go-nuts] Question about runtime.Pinner

2023-10-12 Thread Ian Lance Taylor
On Thu, Oct 12, 2023 at 5:06 AM Pascal Costanza wrote: > > I have a question about runtime.Pinner: The documentation states that you can > only pin an object when it’s the result of calling new, taking the address of > a composite literal, or taking the address of a local variable. > > At the sa

[go-nuts] Re: Question about runtime.Pinner

2023-10-12 Thread 'Michael Knyszek' via golang-nuts
On Thursday, October 12, 2023 at 8:07:02 AM UTC-4 Pascal Costanza wrote: Hi, I have a question about runtime.Pinner: The documentation states that you can only pin an object when it’s the result of calling new, taking the address of a composite literal, or taking the address of a local variab

Re: [go-nuts] Question about runtime.Pinner

2023-10-12 Thread 'Michael Knyszek' via golang-nuts
On Thursday, October 12, 2023 at 9:55:12 AM UTC-4 Ian Lance Taylor wrote: On Thu, Oct 12, 2023 at 5:06 AM Pascal Costanza wrote: > > I have a question about runtime.Pinner: The documentation states that you can only pin an object when it’s the result of calling new, taking the address of a

[go-nuts] Re: Recommended way to distribute pre-compiled C-dependencies for modules using CGO ?

2023-10-12 Thread Tamás Gulácsi
Can't you build (make go build for you) those libraries? For example, see github.com/godror/godror just includes the sources of that third party library in an "odpi" subdir, and with ``` /* #cgo CFLAGS: -I./odpi/include -I./odpi/src -I./odpi/embed #include "dpi.c" */ import "C" ``` it is compile

Re: [go-nuts] bufio.Scanner - possible bug or doc err?

2023-10-12 Thread 'Mark' via golang-nuts
I have written and attached an example that compares bufio.Reader and bufio.Scanner. Here's the output from `go run .` (a line count followed by the first error encountered): ``` Reader 1333665 Scanner 58 bufio.Scanner: token too long ``` This probably _won't_ fail on your 2M line file; it l

Re: [go-nuts] bufio.Scanner - possible bug or doc err?

2023-10-12 Thread Ian Lance Taylor
On Thu, Oct 12, 2023 at 10:21 AM 'Mark' via golang-nuts wrote: > > The docs for bufio.Scanner do say > "Programs that need more control over error handling or large tokens, or must > run sequential scans on a reader, should use bufio.Reader instead" > Perhaps it would be more helpful to mention w

Re: [go-nuts] bufio.Scanner - possible bug or doc err?

2023-10-12 Thread 'Mark' via golang-nuts
Yes, I can see now. Perhaps consider changing: Programs that need more control over error handling or large tokens, or must run sequential scans on a reader, should use bufio.Reader instead. to: Programs that need more control over error handling or large tokens (such as lines longer than Ma