Amusingly we wrote our PDF table extractor largely in
Go: https://pdftables.com/
It identifies tables and cells by looking at the statistical distribution
of glyph boundaries on the pages
rather than inferring anything from the way the text is logically grouped
within the PDF.
There are many ap
I made some changes to use range over int in our code base and was
pleasantly surprised with the improvement in readability.
We had quite a few instances where the number of iterations involved a
function call which we don't want to repeat:
- for i, n := 0, f(); i < n; i++ {
+ for i := range f(
I would argue that it doesn't matter.
The buffers in the operating system can often substantially exceed the size
of those in the Go runtime.
Try using an artificially slow reader (e.g. curl --limit-rate) and you
should see.
Why do you care about buffering in Go vs the OS?
On Sunday, 19 November
gt;> See https://go.dev/ref/spec#Type_definitions and
>> https://go.dev/ref/spec#Type_identity. In particular this statement: "The
>> new type is called a *defined type*. It is different
>> <https://go.dev/ref/spec#Type_identity> from any other type, including
>&g
Why does this not work?
https://go.dev/play/p/dodUj441xJS
Produces the rather strange error message:
./prog.go:7:6: cannot use []t{…} (value of type []struct{f string}) as
[]struct{f string} value in argument to m.F
--
You received this message because you are subscribed to the Google Groups
What is the reason for including the unused parameter in the function
signature?
If it was a method and the reason was to comply with an interface signature
then you can assert the interface to get unparam to ignore:
var _ InterfaceType = (*MyType)(nil)
or if not a pointer receiver
var _ Inter
Do you really need the branch? You get the commit hash for free since Go
1.18 : https://tip.golang.org/doc/go1.18#go-version
You can see the embedded version information with: go version -m
On Monday, 6 February 2023 at 17:33:53 UTC burker...@gmail.com wrote:
> You can use go:generate and go:e
This seems a noddy question but can't easily find an answer with Google
apparently. I may have lost the plot :-)
There is a repo which contains source for a go executable that I want to
use.
Normally I install this with: go install original.domain/path@latest
I want to fork that repo and make so
> Interestingly, I couldn't put the asStr() code in the String() function
since doing so produced this error:
>
> invalid operation: cannot use type assertion on type parameter value
element (variable of type T constrained by comparable)
You need to convert to "any": https://go.dev/play/p/1pMhs