Re: [go-nuts] Re: Why this compilation error ?

2025-03-17 Thread Jan Mercl
On Mon, Mar 17, 2025 at 9:45 AM tapi...@gmail.com wrote: > You can use *new(Version) instead of Version{} to avoid parsing ambiguity. FTR: This would never pass my review. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from thi

Re: [go-nuts] Why this compilation error ?

2025-03-16 Thread Jan Mercl
On Sun, Mar 16, 2025 at 2:30 PM 'Christophe Meessen' via golang-nuts wrote: > You'll find the minimal example code generating the compilation error > here: https://go.dev/play/p/Vb-dNr2DpzM > > It is easy to get around it as the example shows. Why is the compiler > considering this as an error ?

Re: [go-nuts] Why does this channel-based pub/sub broker panic?

2025-03-04 Thread Jan Mercl
On Tue, Mar 4, 2025 at 2:55 PM cpu...@gmail.com wrote: > Thanks Jan, but this just confirms that there is a send on a closed channel. It shows the code is "actively" closing a channel that will be later used for sending. Meaning the problem is possibly not in the send, but

Re: [go-nuts] Why does this channel-based pub/sub broker panic?

2025-03-04 Thread Jan Mercl
On Tue, Mar 4, 2025 at 2:41 PM cpu...@gmail.com wrote: > I've recently run across > https://stackoverflow.com/questions/36417199/how-to-broadcast-message-using-channel > by icza and tried to use the simple broker in my project. > > Unfortunately, it panics with send on closed channel. I couldn

Re: [go-nuts] Analyzing goroutine heap allocations (leak)

2025-02-24 Thread Jan Mercl
On Mon, Feb 24, 2025 at 9:20 AM Gavra wrote: > I am not sure I understand. I have the issue reproducing only in production > on a running instance... Not mentioned in the OP. You can still try to write tests and/or benchmarks that exhibit the same memory leak and then use them with the -memprof

Re: [go-nuts] Analyzing goroutine heap allocations (leak)

2025-02-23 Thread Jan Mercl
On Sun, Feb 23, 2025 at 1:12 PM Gavra wrote: > I have a heap profile that shows that many allocations are generated in a function that runs in a go routine. Unfortunately, I can't see the caller(s) to this function, implying I cannot detect the one holding the reference (and causing the mem leak)

Re: [go-nuts] why url.Parse return err=nil with an apparently invalid URL

2025-02-20 Thread Jan Mercl
On Thu, Feb 20, 2025 at 1:06 PM Lin Lin wrote: > I think that's a little conflict with Go's convention. If the error is nil, one can be sure any returned Object is good. In this case, how can the caller trust the result? Or we can improve the doc to explain a bit more. I believe most Go developers

Re: [go-nuts] Trying to write a web scraper that checks dead links on a webapge

2025-02-13 Thread Jan Mercl
On Thu, Feb 13, 2025 at 2:30 PM Dennis Lee wrote: > I use: > - go version go1.22.3 windows/amd64 Too old Go version, see https://tip.golang.org/doc/go1.23 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

Re: [go-nuts] Trying to define generic methods to access a memory cache

2025-02-12 Thread Jan Mercl
On Wed, Feb 12, 2025 at 11:34 PM David Karr wrote: > > Ok, good to know. How do I solve this problem? It almost looks like I have to > create a slice of the generic type and iterate through the entries in the > commitsCache result, doing a type conversion of every entry. I don't know what probl

Re: [go-nuts] Trying to define generic methods to access a memory cache

2025-02-12 Thread Jan Mercl
On Wed, Feb 12, 2025 at 10:54 PM David Karr wrote: `[]any` is a slice type (https://go.dev/ref/spec#Slice_types), not an interface type (https://go.dev/ref/spec#Interface_types). But type assertions, as in `expr.(someType)`, are valid only for interface types: https://go.dev/ref/spec#Type_assert

Re: [go-nuts] Fscan() eats 1st char in scanning values

2025-01-27 Thread Jan Mercl
On Mon, Jan 27, 2025 at 6:54 PM 'Ivan Burak' via golang-nuts wrote: WAI: https://go.dev/play/p/4bWHGemItL_9 -- 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 i

Re: [go-nuts] how to get dirt memory in go

2025-01-14 Thread Jan Mercl
On Tue, Jan 14, 2025 at 2:44 PM Vasiliy Tolstov wrote: > Hi! I'm try to search answers but have no luck. In go i can create > memory arena/ buffer pool etc.. > But does it possible to get memory with like make([]byte, XXX) but > without calloc for this memory? Not sure if it&#x

Re: [go-nuts] GoImports version

2024-10-18 Thread Jan Mercl
On Fri, Oct 18, 2024 at 9:17 AM 'Axel Wagner' via golang-nuts wrote: > I tried it out and the format parsed by debug.ParseBuildInfo is almost > exactly what is output by go version -m: > https://go.dev/play/p/L-MNzr0EnjV > (and yes, my goimports version is old) And https://go.dev/play/p/bgeGr2h

Re: [go-nuts] [ANN] tk9.0: The CGo-free, cross platform GUI toolkit for Go

2024-10-14 Thread Jan Mercl
On Mon, Oct 14, 2024 at 9:28 PM robert engels wrote: > This what it look like… it transpiles the libX library (on linux and osx > anyway), in order to bind to the X Window system. darwin/macOS is supported by the purego project and on that target Tcl/Tk uses Aqua, not XQuartz(X11) for the GUI.

Re: [go-nuts] Re: [ANN] tk9.0: The CGo-free, cross platform GUI toolkit for Go

2024-10-14 Thread Jan Mercl
On Mon, Oct 14, 2024 at 9:16 PM 'Brian Candler' via golang-nuts wrote: > Or it could be like https://pkg.go.dev/modernc.org/sqlite, which took the > Sqlite C source code and transpiled it into pure Go. It's both, depending on target. The targets supported by ebitengine/purego[0] link dynamicall

Re: [go-nuts] Alignment guarantees of heap allocations

2024-10-10 Thread Jan Mercl
On Thu, Oct 10, 2024 at 2:23 PM 'Timo Beckers' via golang-nuts wrote: > I've been searching around for some info or existing conversations around > this topic, but that hasn't turned up anything useful so far. I had a > question around some implicit behaviour of Go's heap allocator. >From the

Re: [go-nuts] Re: [ANN] tk9.0: The CGo-free, cross platform GUI toolkit for Go

2024-10-02 Thread Jan Mercl
On Wed, Oct 2, 2024 at 3:07 PM Mandolyte wrote: > What did I do wrong? Copying the go.mod file effectively declares the code in hello.go to be in package modernc.org/tk9.0. That's the package hello.go imports, hence the import cycle. This works here: jnml@t3610:~/tmp$ mkdir tk jnml@t3610:~/tmp$

Re: [go-nuts] [ANN] tk9.0: The CGo-free, cross platform GUI toolkit for Go

2024-09-28 Thread Jan Mercl
On Sat, Sep 28, 2024 at 10:09 PM 'Brian Candler' via golang-nuts wrote: > Aside: on front page: "Viewing this on go.pkg.dev?" > > Actually I was viewing it on pkg.go.dev :-) Thanks to D. Honnef on Slack for revealing to me the [invisible to me] difference between go.pkg.dev and pkg.go.dev. Fix c

Re: [go-nuts] [ANN] tk9.0: The CGo-free, cross platform GUI toolkit for Go

2024-09-28 Thread Jan Mercl
On Sat, Sep 28, 2024 at 10:09 PM 'Brian Candler' via golang-nuts wrote: > Aside: on front page: "Viewing this on go.pkg.dev?" > > Actually I was viewing it on pkg.go.dev :-) The text in the picture tries to nudge you into expanding the README.md section on go.pkg.dev, where it is collapsed by de

[go-nuts] [ANN] tk9.0: The CGo-free, cross platform GUI toolkit for Go

2024-09-28 Thread Jan Mercl
http://modernc.org/tk9.0 -- 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

Re: [go-nuts] Perplexing error

2024-09-09 Thread Jan Mercl
On Mon, Sep 9, 2024 at 9:24 PM P Padil wrote: > Can someone please explain to me why the following doesn’t work: > > slices.SortFunc(ilps, func(u, w *big.Int) int { return u.Cmp(w) }) > > I get: > slices.SortFunc(ilps, (func(u, w *big.Int) int literal)) (no value) used as > value Providing a co

Re: [go-nuts] Suppress GoFmt-generated error with/tools.go?

2024-08-31 Thread Jan Mercl
On Sat, Aug 31, 2024 at 2:22 PM Mike Schinkel wrote: > go fmt ./tools.go 'go fmt' is not gofmt. The OP talks about gofmt. I haven't tried anything but you may try if using gofmt instead of 'go fmt' makes a difference. -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] Imitating tuple in golang

2024-08-08 Thread Jan Mercl
On Thu, Aug 8, 2024 at 9:35 PM 'lijh8' via golang-nuts wrote: > I try to use slice of any to imitate the tuple type, > and use this function to compare two slices: a, b. > > How can I improve it? Take a look at https://pkg.go.dev/slices#Compare if it can fit your use case. -- You received this

Re: [go-nuts] this code sometimes hangs

2024-07-18 Thread Jan Mercl
On Thu, Jul 18, 2024 at 4:24 PM Lammie Jonson wrote: > goroutineRunning.Done() Should be defer goroutineRunning.Done() (not tested) -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop rece

Re: [go-nuts] Importing non-module based code

2024-07-16 Thread Jan Mercl
On Tue, Jul 16, 2024 at 3:57 PM Robert Engels wrote: > Yes, I just added that tag and pushed it, but @latest wouldn’t pick it up for > some reason, needed to specify the release exactly using @v0.3.1 @latest is the "latest" known to the proxy server. It has some varying delay to update. -- Yo

Re: [go-nuts] Importing non-module based code

2024-07-16 Thread Jan Mercl
On Tue, Jul 16, 2024 at 3:50 PM Robert Engels wrote: > > Weird, even after I added the tag, using @latest did not pull the latest > code, I needed to specify the tag specifically @v0.3.1 I think I see the exported identifiers you need in v0.3.1, published 2018: https://pkg.go.dev/github.com/rob

Re: [go-nuts] Importing non-module based code

2024-07-16 Thread Jan Mercl
On Tue, Jul 16, 2024 at 3:41 PM 'Robert Engels' via golang-nuts wrote: > The go get works, and the code is there, but it isn’t seeing my code - it > seems like it is using the original gocui which has since added module > support. > > cmd/client/main.go:43:7: gui.Update undefined (type *gocui.G

Re: [go-nuts] Benchmark "overall" operation

2024-07-08 Thread Jan Mercl
On Mon, Jul 8, 2024 at 10:36 PM Robert Engels wrote: > Is there anyway to do what I want? The usual way is to factor out any parts that can skew the results before the benchmark loop and call b.ResetTimer() just before entering the 'for i := 0; i < b.N; i++ {' loop. > If not, maybe a useful add

Re: [go-nuts] Benchmark "overall" operation

2024-07-08 Thread Jan Mercl
On Mon, Jul 8, 2024 at 10:08 PM 'Robert Engels' via golang-nuts wrote: > Given this code (which I know is not “correct”): Setting b.N in the benchmark code has no specified behavior. The actual behavior at the moment ignores such changes. The algorithm used by the testing package adjusts b.N in

Re: [go-nuts] Does data race with only multiple goroutine parallel i=1 have an impact on the execution results?

2024-07-06 Thread Jan Mercl
On Sat, Jul 6, 2024 at 5:21 PM Robert Engels wrote: > That is not a data race. The wait group is a synchronization barrier. Multiple concurrent, uncoordinated writers are a perfect data race. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] Comparison of pointers to distinct zero-sized variables

2024-06-20 Thread Jan Mercl
On Thu, Jun 20, 2024 at 1:26 PM 'Axel Wagner' via golang-nuts wrote: > (apologies for the abundance of grammatical and spelling errors that occurred > during editing and of course only became visible after hitting "send") (Send collapses the wave function ;-) -- You received this message bec

Re: [go-nuts] Comparison of pointers to distinct zero-sized variables

2024-06-20 Thread Jan Mercl
On Thu, Jun 20, 2024 at 1:16 PM Oliver Eikemeier wrote: > • Pointer types are comparable. Two pointer values are equal if they point to > the same variable or if both have value nil. Pointers to distinct zero-size > variables may or may not be equal. Compare to (made up) "NaNs always compare n

Re: [go-nuts] Comparison of pointers to distinct zero-sized variables

2024-06-20 Thread Jan Mercl
On Thu, Jun 20, 2024 at 12:28 PM Oliver Eikemeier wrote: > It mentions “pointers” (plural) to zero-sized variables, but for this > behavior it is sufficient when only one pointer derives from a pointer to a > zero-sized variable, as demonstrated in the example below. The plural is there becaus

Re: [go-nuts] Symbol of const string are not exported by compiler

2024-05-30 Thread Jan Mercl
On Thu, May 30, 2024 at 10:34 AM Benoît Marguerie wrote: > I discovered a "strange" behavior doing a simple operation. > I defined 2 const : one integer and one string. With delve (or other > debugger), I'm able to consult the const integer value but not the const > string value. Delve team exp

Re: [go-nuts] encoding/asn1 I can't Marshal a struct with pointer members

2024-04-27 Thread Jan Mercl
On Sun, Apr 28, 2024, 03:03 J Liu <8859210...@gmail.com> wrote: > My program is like this: > > type Girl struct { > Name string > Age int > } > > type Person struct { > girl *Girl > job string > } > > > What should I do to Marshal 'Person'? > I think you need to export th

Re: [go-nuts] Is golang.org/x/text/message's Printer thread safe?

2024-04-22 Thread Jan Mercl
On Mon, Apr 22, 2024 at 11:23 AM Xiangrong Fang wrote: > Is golang.org/x/text/message's *message.Printer safe to use in goroutines? I don't know, but usually things are safe for concurrent use by multiple goroutines only when explicitly documented as such. -- You received this message because

Re: [go-nuts] Nillable basic types?

2024-03-18 Thread Jan Mercl
On Mon, Mar 18, 2024 at 4:41 AM Daniel Lepage wrote: > This change would be entirely backward-compatible ... Let's consider, for example, the type uint8, aka byte. A variable of type byte is specified* to occupy 8 bits of memory and has 256 possible values. To represent all those values and the

Re: [go-nuts] GO111MODULE=off go get deprecated?

2024-03-07 Thread Jan Mercl
On Sun, Mar 3, 2024 at 10:25 PM Jeffery Carr wrote: > Has this been deprecated or maybe it is broken in debian sid, but: > > bash$ GO111MODULE=off go get -v go.wit.com/apps/test > go: modules disabled by GO111MODULE=off; see 'go help modules' > basj$ go version > go version go1.22.0 linux/amd64 >

Re: [go-nuts] Enums, Go1 and proposals

2024-03-04 Thread Jan Mercl
On Mon, Mar 4, 2024 at 6:19 PM Jeremy French wrote: > More, to prevent PrintMonth(14), which the function would have to check for > and either return an error or panic, since there is no meaningful output. In > fact, it's fairly easy to see, even in this case, where the PrintMonth > signature

Re: [go-nuts] Enums, Go1 and proposals

2024-03-04 Thread Jan Mercl
On Mon, Mar 4, 2024 at 4:19 PM Jeremy French wrote: > It's checked at compile-time rather than run time. That requires immutability of variables of enum type. Go does not support immutable variables. -- You received this message because you are subscribed to the Google Groups "golang-nuts" gr

Re: [go-nuts] Equality of interface of an empty struct - why?

2024-02-26 Thread Jan Mercl
On Tue, Feb 27, 2024 at 6:20 AM tapi...@gmail.com wrote: > From common sense, this is an obvious bug. But the spec is indeed not clear > enough. > It doesn't state whether or not comparisons of pointers to two distinct > zero-size variables should be consistent in a run session. > Though, from

Re: [go-nuts] Unhappy with the official generics tutorial

2024-02-22 Thread Jan Mercl
On Thu, Feb 22, 2024 at 10:06 AM 'Carla Pfaff' via golang-nuts wrote: > This omission is notable considering "any" is among the most frequently used > constraints in writing generic code. Interesting to know, I'd naively guess the opposite. Can you please share the source data set? Thank you.

Re: [go-nuts] Ghost/indirect dependency on a custom package

2024-02-20 Thread Jan Mercl
On Tue, Feb 20, 2024 at 11:07 AM Peter Bočan wrote: > Is there a way to debug this? Is there a way to step over the initialisation > order? I try to get help from '$ go mod graph' in similar investigations. -- You received this message because you are subscribed to the Google Groups "golang-

Re: [go-nuts] big int panic on text conversion

2024-02-14 Thread Jan Mercl
On Wed, Feb 14, 2024 at 12:14 PM 'Dan Kortschak' via golang-nuts wrote: > Given that this can happen without a race or unsafe modifications it > might be worth filing a issue for. I think this is expected. Quoting from the big.Int docs https://pkg.go.dev/math/big#Int To "copy" an Int value

Re: [go-nuts] How could we emulate condition variables using Go channels only?

2024-01-12 Thread Jan Mercl
On Fri, Jan 12, 2024 at 7:57 PM Rochus Keller wrote: > Here is the full question with examples (though meanwhile closed as usual in > recent times on stackoverflow, so answer here please): > https://stackoverflow.com/questions/77802102/mutex-and-condition-variables-in-go-without-using

Re: [go-nuts] Re: Rendering fonts in Go

2024-01-12 Thread Jan Mercl
On Fri, Jan 12, 2024 at 12:34 PM 'Brian Candler' via golang-nuts wrote: > At worst, it may possible to compile C into Go. It sounds mad, but I believe > SQLite has been ported to pure Go this way. Challenge accepted: https://pkg.go.dev/modernc.org/libfreetype -- You recei

Re: [go-nuts] Re: A global panic handler for crash reporting

2023-12-26 Thread Jan Mercl
On Tue, Dec 26, 2023 at 9:12 AM Gergely Brautigam wrote: > If you have a top level recover in you main, it doesn't matter where the > panic happens, you'll capture it. Even in third party library. Iff the panic occurs in the same goroutine where the defer is. Every go statement starts a new gor

Re: [go-nuts] circular package dependency between golang.org/x/mod and golang.org/x/tools

2023-12-19 Thread Jan Mercl
On Tue, Dec 19, 2023 at 9:37 PM Nathan Lacey wrote: > I noticed that we have a circular dependency between golang.org/x/mod and > golang.org/x/tools > > golang.org/x/mod zip/zip_test.go includes golang.org/x/tools > I think we could get rid of the circular package dependency by changing that

Re: [go-nuts] Need help running "go get" on self hosted git server

2023-12-18 Thread Jan Mercl
On Mon, Dec 18, 2023 at 2:19 PM Brijesh Wawdhane wrote: > I added a go-import meta tag to my git server's website on the repo page and it looks like > > https://brijesh.dev/kairos.git";> > > but when I try running "go get brijesh.dev/kairos" I get an error saying 'go: unrecognized import path "br

Re: [go-nuts] detecting deleted file that is still open and appending without error in Go?

2023-12-10 Thread Jan Mercl
On Sun, Dec 10, 2023 at 8:34 PM Jason E. Aten wrote: > I noticed that the binary log was not growing, and its update timestamp was > not changing. I think the file was still growing as intended. It was only no more associated with the _new_ entry/name in the directory. I'm pointing it out becau

Re: [go-nuts] detecting deleted file that is still open and appending without error in Go?

2023-12-10 Thread Jan Mercl
On Sun, Dec 10, 2023 at 5:41 PM Jason E. Aten wrote: > My question is: is there a way to have the Go process detect if the file it > is writing to has been deleted by another process (git in this case) so that > attempting to append to the file is no longer effective? It is effective and [most

Re: [go-nuts] Go ARM

2023-11-15 Thread Jan Mercl
On Wed, Nov 15, 2023 at 9:59 PM Stephen Illingworth wrote: > > That works better although not perfectly for my purposes. More work required > from me. > > I'm curious though, about the -marm flag. How can I remove it from the > GOGCCFLAGS variable? Or are we saying we can't use the aarch64 compi

Re: [go-nuts] Go ARM

2023-11-15 Thread Jan Mercl
On Wed, Nov 15, 2023 at 8:30 PM Stephen Illingworth < stephen.illingwo...@gmail.com> wrote: > I'm trying to build a project on the Raspberry Pi, natively. > > Using "go env" I can see that Go has the following value for GOGCCFLAGS > > GOGCCFLAGS='-fPIC -marm -Wl,--no-gc-sections -fmessage-length=0

[go-nuts] Re: Why golang's garbage collector didn't free obj when an finalizer is associate with it?

2023-11-08 Thread Jan
explanation. On Tuesday, November 7, 2023 at 3:51:51 PM UTC+1 Michael Knyszek wrote: > On Tuesday, November 7, 2023 at 2:32:28 AM UTC-5 Jan wrote: > > Btw, I don't follow the sentence: > > "the GC necessarily has to keep referents of the object-to-be-finalized > live eve

Re: [go-nuts] ldflags -X

2023-11-08 Thread Jan Mercl
On Wed, Nov 8, 2023 at 4:01 PM Stephen Illingworth wrote: > I would have expected the "main.A" string to require the same form. But > either way, that's the correct solution. It is the correct form. Package main cannot be imported and has a special import path. Though I don't know where it is d

Re: [go-nuts] ldflags -X

2023-11-08 Thread Jan Mercl
On Wed, Nov 8, 2023 at 1:35 PM Stephen Illingworth < stephen.illingwo...@gmail.com> wrote: > > Hello, > > I'm trying to use the -X ldflag to set a string at compile time. I can do this successfully if the string is in the main package but it does not work if the string is in a subpackage. > > For i

[go-nuts] Re: Why golang's garbage collector didn't free obj when an finalizer is associate with it?

2023-11-06 Thread Jan
; >> Does this behaviour mean that, those memory will never be freed and keep >> piling on ? That can be disastrous. >> >> On Monday, November 6, 2023 at 3:39:50 PM UTC+5:30 Jan wrote: >> >>> For what it's worth, a bit of "memory management"

[go-nuts] Re: Why golang's garbage collector didn't free obj when an finalizer is associate with it?

2023-11-06 Thread Jan
ointers (`shred_ptr<>`), which gets most of the benefit of GC, but with a much lower cost. They required manually breaking cycles, which I didn't find to be an issue at all in the great majority of the cases. On Monday, November 6, 2023 at 11:01:04 AM UTC+1 Jan wrote: > I was ver

[go-nuts] Re: Why golang's garbage collector didn't free obj when an finalizer is associate with it?

2023-11-06 Thread Jan
I was very surprised by this behavior of SetFinalizer: and indeed if you remove the SetFinalizer one can see that s1 is freed, because the memory reported by `m.HeapAlloc` goes back down. I think you already have the answer: the block that has the cycle (s1 and s2) have a SetFinalizer set, and

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

2023-11-03 Thread Jan
eally production ready when trying to run it on > blah standard Ubuntu 22. > > On Wednesday, November 1, 2023 at 9:08:51 PM UTC Jan wrote: > >> Thanks @Jason, but the point was exactly not need to do anything extra: >> no manual unzipping of a file, or manual Makefile/Mage

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

2023-11-01 Thread Jan
Thanks @Jason, but the point was exactly not need to do anything extra: no manual unzipping of a file, or manual Makefile/Magefile. Let's say project in Go links some 30 external modules, 5 of them have their own specific steps that need to be read, understood and and run to install them ... ve

Re: [go-nuts] Re: recommended statistics package? Requirements: ANOVA, Brown-Forsythe

2023-10-24 Thread Jan
2yDRof0z > > Have fun! > > On 10/23/23 07:38, Jan wrote: > > hi, I did a quick search and I didn't find anything in Go. But looking > > at the definition and at one implementation in JS > > < > https://github.com/lukem512/brown-forsythe-test/blob/master/src/br

[go-nuts] Re: recommended statistics package? Requirements: ANOVA, Brown-Forsythe

2023-10-22 Thread Jan
hi, I did a quick search and I didn't find anything in Go. But looking at the definition and at one implementation in JS , it sounds something relatively easy to write and share :) You can use the R implementat

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

2023-10-20 Thread Jan
> exposes a higher level abstraction for the user. > > > With only headers and static libs in the thirdparty directory, is this > package "go-gettable"? > Will go make the subdirectory available in that case? It usually ignores > if there is no Go source files. &g

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

2023-10-15 Thread Jan
; files in it). > > So your next mission is to prepare the right #cgo CFLAGS LDFLAGS > incantations to use those libraries. > > Jan a következőt írta (2023. október 14., szombat, 8:37:48 UTC+2): > >> Thanks Tamás, I may not be understanding correctly, but after taking a

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

2023-10-13 Thread Jan
ot;require.go" in the odpi/* subdirs). > But it may work that your precompiled libs in a subdir, with a mock .go > file gets downloaded. > But how will it found by your lib/app ? > > Tamás > > > Jan a következőt írta (2023. október 12., csütörtök, 8:14:41 UTC+2): > &g

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

2023-10-11 Thread Jan
ed up by go compiler automatically (setting up of CGO's CFLAG, LDFLAG LD_LIBRARY_PATH, etc), and be removed if no longer used ? With minimum user headache/work... cheers Jan On Thursday, October 12, 2023 at 3:16:58 AM UTC+2 Tim Casey wrote: > > > I would put down Makefile includes for the s

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

2023-10-11 Thread Jan
n, does something very similar. > > - Rich > > On Wednesday, October 11, 2023 at 2:58:23 AM UTC-7 Jan wrote: > >> hi, >> >> I'm developing a couple of ML framework/libraries for Go that depend on >> C/C++ code. Once C-libraries dependencies are installed, the C

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

2023-10-11 Thread Jan Mercl
On Wed, Oct 11, 2023 at 8:11 PM Torsten Bronger wrote: > Then, all boils down to the fact that you can’t pass []float64 as an > []any. To be honest, I still don’t fully understand why this is > forbidden, so I just accept that the language does not allow it. It's the same reason why one cannot

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

2023-10-11 Thread Jan
uild tags are >> there to not require GLIBC for user and dns lookups. >> >> >> >> On Wednesday, 11 October 2023 at 11:43:20 UTC+1 Jan wrote: >> >>> Edit: ...so folks using your library don't need to install them manually >>> ? What about u

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

2023-10-11 Thread Jan
Edit: ...so folks using your library don't need to install them manually ? What about uninstalling ? On Wednesday, October 11, 2023 at 12:41:40 PM UTC+2 Jan wrote: > Thanks Peter, but I don't follow ... I also use docker to build the > pre-built binaries. > > But how do y

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

2023-10-11 Thread Jan
t; > Peter > > On Wednesday, 11 October 2023 at 10:58:23 UTC+1 Jan wrote: > >> hi, >> >> I'm developing a couple of ML framework/libraries for Go that depend on >> C/C++ code. Once C-libraries dependencies are installed, the CGO >> integration work great

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

2023-10-11 Thread Jan
s in a sub-directory of the python library installation. I was hoping there would be a similar way (maybe with a separate tool) to integrate with `go.mod`. Any pointers, thoughts or suggestions are very appreciated. Thanks! Jan ps: While searching I saw similar questions, but none that exactl

Re: [go-nuts] how do you compie and link a go main with an assembly code file?

2023-10-09 Thread Jan Mercl
On Mon, Oct 9, 2023 at 6:02 PM Peter Riemenschneider wrote: Just '$ go build' as usual, but one must declare the asm function: https://go.dev/play/p/KySqFvCVz_T -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and

Re: [go-nuts] The docs for secretbox seem very wrong

2023-10-09 Thread Jan Mercl
On Mon, Oct 9, 2023 at 3:46 PM Dean Schulze wrote: > If the docs are correct, how do you append to nil? https://go.dev/play/p/WY0Bycj-_Tn -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails

Re: [go-nuts] Help understanding slices, variable arguments, and passing slices to functions

2023-09-25 Thread Jan Mercl
On Mon, Sep 25, 2023 at 1:57 PM Andrew Pillar wrote: A nice discussion of slices can be found for example here: https://research.swtch.com/godata tl;dr: Yes, slices are passed by value (everything in Go is passed by value), but a slice does not contain the backing array, only a pointer to it. -

Re: [go-nuts] Re: Weird error when trying to fetch a module.

2023-09-15 Thread Jan Mercl
On Fri, Sep 15, 2023 at 10:31 AM 'Jim Idle' via golang-nuts < golang-nuts@googlegroups.com> wrote: > The go.mod at the root was one thing that might work, but it will cause the entire repo to be pulled in so the tag will still have to be sec/go/ etc. tl;dr: Putting a go.mod in the repository root

Re: [go-nuts] How ignore a subdirectory

2023-09-13 Thread Jan Mercl
On Wed, Sep 13, 2023 at 12:25 PM John Souvestre wrote: > I did try that also. I get this error message: > > CreateFile *.go: The filename, directory name, or volume label syntax is incorrect. Sorry, I'm not familiar with Windows and only TIL cmd.exe does not expand globs. I suggest to instal

Re: [go-nuts] How ignore a subdirectory

2023-09-12 Thread Jan Mercl
On Wed, Sep 13, 2023 at 5:47 AM 'John Souvestre' via golang-nuts wrote: > I’m trying to run gofmt on all of the .go files in a directory, but not any > subdirectories. $ gofmt *.go -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscrib

Re: [go-nuts] How to constrain an integral type's values

2023-09-08 Thread Jan Mercl
On Fri, Sep 8, 2023 at 9:24 AM 'Mark' via golang-nuts wrote: > Is there a compile-time solution for this that I've missed? No. Go does not have enum types. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

[go-nuts] Re: does gonum insist on row-major?

2023-08-26 Thread Jan
Not exactly what you asked, but something that you may consider: GoMLX . It's an accelerated ML and Math library that uses XLA --> it just-in-time compiles a computation graph to CPU/GPU (and hopefully soon TPU). It powers Jax/Ten

Re: [go-nuts] Re: Best IDE for GO ?

2023-08-26 Thread Jan Mercl
On Sat, Aug 26, 2023 at 2:33 PM Jason E. Aten wrote: > > Is there any IDE that allows you to jump through a stack trace like emacs > does? I think many code editors can do that, for example vim: https://vim.fandom.com/wiki/Open_file_under_cursor -- You received this message because you are sub

[go-nuts] Re: Would it be possible to make this work in the future?

2023-08-26 Thread Jan
Notice that if you don't assign to `tok`, multiple alternatives in `case` works. But the issue is that in Go there are no "duck typing" for data, only for methods (interfaces). `xml.StartElement` and `xmlEndElement` not being the same type, the assignment ('tok.name.Local = "types"`) won't wor

[go-nuts] Re: custom coverage report

2023-08-24 Thread Jan
hey Vasiliy, I'm not sure I understood your requirements, but let me take a stab at it. By handlers of the protobuf I imagine you refer to those stubs generated by `protoc`, for the gRPCs. Is it correct ? They have well defined names/packages that can easily be filtered (grep?) from the the u

Re: [go-nuts] Re: [ANN] go-zeromq/zmq4: pure-Go implementation of ZeroMQ

2023-08-24 Thread Jan
Btw, I should add to it that GoNB , a successor to gophernotes also uses github.com/go-zeromq/zmq4 to communicate with Jupyter -- it's been working flawlessly for that use case. On Thursday, August 24, 2023 at 3:20:49 PM UTC+2 Sebastien Binet wrote: > Hi t

Re: [go-nuts] Best IDE for GO ?

2023-08-19 Thread Jan Mercl
On Sat, Aug 19, 2023 at 10:06 PM Christian Stewart wrote: > Autocomplete and a go language server (gopls) add a ton of speed because you > don't need to look up the docs for function and variable names. And go to > definition improves speed navigating code significantly. - Using autocomplete a

Re: [go-nuts] Best IDE for GO ?

2023-08-19 Thread Jan Mercl
On Sat, Aug 19, 2023 at 9:42 PM Robert Engels wrote: > I guarantee that two developers of equal competence - the one with a powerful > IDE will outperform the other using a text editor with syntax highlighting > (but come on that is a crutch a real developer doesn’t need) by 2-10x > depending

Re: [go-nuts] Best IDE for GO ?

2023-08-19 Thread Jan Mercl
On Sat, Aug 19, 2023 at 11:27 AM alex-coder wrote: > Gophers, may be there is another place where I should look for IDE for GO ? Unix is my IDE and vim is its prophet. IME IDEs make programmers write low quality code while enjoying the illusion of being "more productive". -- You received this

[go-nuts] Re: Test coverage: joint unit test and integration test coverage

2023-08-17 Thread Jan
gocoverdir` doesn't return anything -- in go1.21.0. On Thursday, August 17, 2023 at 8:08:51 AM UTC+2 Jan wrote: > Oh yes, it's true that the new mechanism is more general, and allows > integration tests, it's a huge improvement for cases like this! Thanks for &g

[go-nuts] Re: Test coverage: joint unit test and integration test coverage

2023-08-16 Thread Jan
ot being run as root, especially error > handling. So there is some value in the new mechanism even "just" for unit > tests. Admittedly, not all will need that in their unit tests. > > On Wednesday, August 16, 2023 at 8:53:56 PM UTC+2 Jan wrote: > >> Thanks, that's

[go-nuts] Re: Test coverage: joint unit test and integration test coverage

2023-08-16 Thread Jan
t; Maybe similar to this? > https://github.com/thediveo/lxkns/blob/cef5a31d7517cb126378f81628f51672cb793527/scripts/cov.sh#L28 > > On Wednesday, August 16, 2023 at 1:54:48 PM UTC+2 Jan wrote: > >> hi all, >> >> After reading the documentation >> <https:

[go-nuts] Test coverage: joint unit test and integration test coverage

2023-08-16 Thread Jan
hi all, After reading the documentation , I managed to set up a process in which I compile and run my integration tests, and get coverage from them in the `$GOCOVERDIR` subdirectory. Now I would like to have a combined unit tests + integration te

Re: [go-nuts] Re: Go 1.21.0 is released

2023-08-09 Thread Jan Mercl
On Wed, Aug 9, 2023, 09:12 Marcello H wrote: > https://go.dev/dl/go1.21.0.windows-arm64.zip > > It is found when you click on "Other Ports" Thanks. I may have a false memory of always finding the windows/arm64 port beside the windows/amd64 one in the same section. -j -- You received this mes

[go-nuts] Re: Go 1.21.0 is released

2023-08-08 Thread Jan Mercl
On Tue, Aug 8, 2023 at 5:24 PM wrote: > We have just released Go 1.21.0. > > To find out what has changed in Go 1.21, read the release notes: > https://go.dev/doc/go1.21 > > You can download binary and source distributions from our download page: > https://go.dev/dl/#go1.21.0 It looks like the d

Re: [go-nuts] Re: How to convert an svg to a png (or gif) image?

2023-08-04 Thread Jan Mercl
On Fri, Aug 4, 2023 at 1:22 PM Brian Candler wrote: > Also there's a project which compiles C code to Go - ISTR it was used to > build a pure Go version of Sqlite. Presumably the same approach could be > applied to an image processing library. > > https://twitter.com/bradfitz/status/8552718671

Re: [go-nuts] Re: Error handling

2023-08-01 Thread Jan Mercl
On Tue, Aug 1, 2023 at 1:47 AM DrGo wrote: > The verbosity of error handling is the number one concern for Go developers > in the most recent survey. That says something about those developers, about their preferences, opinions, taste etc and that it differs from what the Original Language Desi

Re: [go-nuts] [go test] pure Test Classes.

2023-07-26 Thread Jan Mercl
On Wed, Jul 26, 2023 at 9:44 AM sumith s wrote: > Currently, we do not have pure Test Classes defined by us. We are using > Golang specific Test Class structure. Each FILENAME_test.go will have its own > test class under "Golang Test". > I'm trying to define a pure Test Classes. how can do tha

Re: [go-nuts] go package dating back to 2009

2023-07-25 Thread Jan Mercl
On Wed, Jul 26, 2023 at 12:32 AM Bravo Moua wrote: > For a fact, bytes, fmt, and packages in those category are from Satoshi > Nakamoto and myself. Extraordinary claims require extraordinary evidence. -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] no way to pause `Listen` on net connections

2023-07-24 Thread Jan Mercl
On Mon, Jul 24, 2023 at 9:26 AM David N wrote: > Yup, this makes sense and should work, but I'm still surprised this can't be > entirely done in Golang. Who says it's not possible? I'm not aware of a reason why the required parts cannot be implemented in pure Go (+ syscalls + right permission b

Re: [go-nuts] no way to pause `Listen` on net connections

2023-07-24 Thread Jan Mercl
On Mon, Jul 24, 2023 at 9:14 AM David N wrote: On Linux you may try fiddling with iptables, limitations apply: https://stackoverflow.com/questions/44464617/stop-accepting-new-tcp-connections-without-dropping-any-existing-ones/44509993#44509993 -- You received this message because you are subscr

  1   2   3   4   5   6   7   8   9   10   >