Re: [go-nuts] Security implications of exposed Go runtime anon pipes

2025-01-09 Thread 'TheDiveO' via golang-nuts
rs of Linux processes are exposed via /proc/$PID/fd/$FD as pseudo symlinks, further meta data about the fds then via /proc/$PID/fdinfo/$FD. This information is quite useful, for instance, for detecting "leaked fds" in Go unit tests, using the fdooze <https://github.com/thediveo/fdooze&

[go-nuts] fun w/ benchmarking os.ReadDir versus os.File.ReadDir...

2024-12-28 Thread &#x27;TheDiveO' via golang-nuts
t") So I learned how to write benchmarks using "testing"; for reference, here's my benchmarking code at the time of this writing readdir_bench_test.go <https://github.com/thediveo/faf/blob/51a7f846d3f851ac65ec9d6b9b03d96cf7365154/readdir_bench_test.go> (Github). The s

Re: [go-nuts] How to correctly phrase documentation about test matchers accepting Go 1.23 iterator functions?

2024-11-14 Thread &#x27;TheDiveO' via golang-nuts
I was asking for the rabbit, *erm Gopher*, hole, so there's a lot for me to learn here! Please be patient with me, I'm trying my best, but the the finer points in Go for me still escape much farther than the heap... On Thursday, November 14, 2024 at 10:50:58 AM UTC+1 Axel Wagner wrote: I woul

[go-nuts] How to correctly phrase documentation about test matchers accepting Go 1.23 iterator functions?

2024-11-14 Thread &#x27;TheDiveO' via golang-nuts
Background: I'm currently working on making the Gomega matcher library iterator-aware as first-class citizens. That is, matchers working on "collection" types such as slice and map will then accept iterator functions and act accordingly. As I also work on updati

[go-nuts] Re: [ANN] miqt: New Qt Widgets binding with MIT license

2024-09-27 Thread &#x27;TheDiveO' via golang-nuts
You can add as a benefit to your module that it avoids the *supply chain nightmare* that thereceipe/qt is (as you describe the latter: "It works by making IPC calls to a separate C++ binary downloaded at runtime from a site under the maintainer's control. This may be less performant than calling

Re: [go-nuts] goroutine priority

2024-09-27 Thread &#x27;TheDiveO' via golang-nuts
were using the Linux with real-time kernel. > > On Sep 27, 2024, at 10:44 AM, 'TheDiveO' via golang-nuts < > golan...@googlegroups.com> wrote: > > you need to keep a bunch of per-cpu ("per-core") kernel threads and you > need to make sure not to st

[go-nuts] Re: goroutine priority

2024-09-27 Thread &#x27;TheDiveO' via golang-nuts
just to be sure: you *do* actually use an RT kernel? I know you can set ff on stock non-RT kernels, but the results can be quite different. On Thursday, September 26, 2024 at 5:49:53 AM UTC+2 Zhao Weng wrote: > Hi gophers, > I'm doing a research on how to prioritise some goroutines over others.

Re: [go-nuts] goroutine priority

2024-09-27 Thread &#x27;TheDiveO' via golang-nuts
: > > What you want to do is start the process with a cset to restrict the cores > it can use - then use the setsched to move certain threads to cores that > have been excluded. > > On Sep 27, 2024, at 10:26 AM, 'TheDiveO' via golang-nuts < > golan...@googlegr

[go-nuts] Re: goroutine priority

2024-09-27 Thread &#x27;TheDiveO' via golang-nuts
Are you running this on a multi-core? Your non-fifo tasks can be scheduled to other cores, et cetera. BTW, fifo 99 is a recipe for desaster as it can starve the kernel on a core, preventing necessary kernel house-keeping. Don't ask me how I know... What is the reason for setting GOMAXPROCS, I'm

[go-nuts] Re: Upgrading to last version of dependency without upgrading toolchain?

2024-05-25 Thread &#x27;TheDiveO' via golang-nuts
For the archeologists, underlying issue has been acknowledged https://github.com/golang/go/issues/67574; sadly, this forum kept schtumm. On Monday, May 6, 2024 at 1:46:17 PM UTC+2 TheDiveO wrote: > As I cannot edit the title anymore: it's about upgrading to the last > version that

[go-nuts] Re: Upgrading to last version of dependency without upgrading toolchain?

2024-05-06 Thread &#x27;TheDiveO' via golang-nuts
As I cannot edit the title anymore: it's about upgrading to the last version that can be used without toolchain change, which is not necessarily the "latest" version of a dependency. On Monday, May 6, 2024 at 10:42:17 AM UTC+2 TheDiveO wrote: > FYI, go-mod-upgrade runs the

[go-nuts] Re: Upgrading to last version of dependency without upgrading toolchain?

2024-05-06 Thread &#x27;TheDiveO' via golang-nuts
FYI, go-mod-upgrade runs the following command under its hood: go list -u -mod=readonly -f '{{if (and (not (or .Main .Indirect)) .Update)}}{{.Path}}: {{.Version}} -> {{.Update.Version}}{{end}}' -m all On Monday, May 6, 2024 at 10:36:08 AM UTC+2 TheDiveO wrote: > Up front, I ha

[go-nuts] Upgrading to last version of dependency without upgrading toolchain?

2024-05-06 Thread &#x27;TheDiveO' via golang-nuts
Up front, I have to admit that I'm struggling with the newly introduced download-your-go-toolchain-on-the-fly when it comes to: 1. having reproducible builds in a CI/CD pipeline without getting downloaded a different toolchain as installed at the stage start, 2. being a module maintaine

[go-nuts] Re: Is json.Marshal deterministic?

2024-04-11 Thread &#x27;TheDiveO' via golang-nuts
They are distinct indeed. An "if sl == nil ..." will not match an empty slice. It is len(sl) that returns 0 for both nil and empty slices, and range working along the same idea. playground example: https://goplay.tools/snippet/df0bG6YXfJZ https://goplay.tools/snippet/df0bG6YXf https://goplay.to

Re: [go-nuts] user process instruction pointer symbol lookup

2024-04-03 Thread &#x27;TheDiveO' via golang-nuts
at 8:01:11 PM UTC+2 Ian Lance Taylor wrote: > On Tue, Apr 2, 2024 at 2:35 AM 'TheDiveO' via golang-nuts > wrote: > > > > On Linux, given an arbitrary binary executable with symbol information > in the executable, how can I lookup an instruction pointer address to get

[go-nuts] user process instruction pointer symbol lookup

2024-04-02 Thread &#x27;TheDiveO' via golang-nuts
On Linux, given an arbitrary binary executable with symbol information in the executable, how can I lookup an instruction pointer address to get the corresponding symbol name? The binary (and its process) isn't a Go binary, but any arbitrary executable. The stack unwinding has already been done

[go-nuts] Re: go test -coverpkg=$LIST ... failing with exit code

2024-03-14 Thread &#x27;TheDiveO' via golang-nuts
Looking and looking again, at least I spotted a lonely "open /tmp/go-build/covmeta: no such file or directory" error message. This now finally matches https://github.com/golang/go/issues/65653 and using gotip finally succeeds correctly. -- You received this message because you are subs

[go-nuts] go test -coverpkg=$LIST ... failing with exit code

2024-03-12 Thread &#x27;TheDiveO' via golang-nuts
Dear Gophers, I'm struggling with "go test -coverpkg=XXX ... ./... -args -test.gocoverdir" returning non-zero exit codes, albeit all tests are passing. It might well be that I'm not really yet understanding how "go test -coverpkg=" is supposed to work. As illustrated below, I don't want to -co

[go-nuts] Re: c-shared library for Aix

2024-03-03 Thread &#x27;TheDiveO' via golang-nuts
llvm/clang? I've ditched gcc because of its many unfixable problems. After loosing quite some time, trying to cross-compile Go using gcc, I've switched to clang IIRC and this works beautifully, especially cross-building for Alpine/musl. However my AIX time with RS6000 was decades ago, and I was

[go-nuts] coverage seems to show code as not covered, but code is actually executed

2024-02-23 Thread &#x27;TheDiveO' via golang-nuts
00 and chair, I just don't see it yet. I see the same behavior with go 1.22.0 as well as 1.21.7. This is the repository where I see the seemingly odd profile: https://github.com/thediveo/notwork (sic!) I run all tests as follows with coverage, see also https://github.com/thediveo/notwork/b

Re: [go-nuts] Could we trade all the `ctx context.Context` arguments for one pointer in `g`?

2024-02-20 Thread &#x27;TheDiveO' via golang-nuts
Forgive me if I missed that, but what if I have multiple context vars, because I need to pass different (derived) contexts into different functions/receivers? Take unit tests as real-world examples. On Wednesday, February 21, 2024 at 1:37:05 AM UTC+1 Sam Vilain wrote: > Alright, well thanks for

[go-nuts] Re: go mod download fails on docker for 1.20 (but not for 1.18)

2024-02-02 Thread &#x27;TheDiveO' via golang-nuts
vereiro de 2024 à(s) 21:07:03 UTC, TheDiveO > escreveu: > >> Are you still using Debian 11 and the outdated Debian docker.io package >> with Docker 18? What happens when you use a recent Docker, either 24.x or >> hot-off-the-press 25.0.1? And then build using a Go-

[go-nuts] morbyd: a thin layer to easily build and run throw-away test containers, etc. in tests

2024-02-02 Thread &#x27;TheDiveO' via golang-nuts
https://github.com/thediveo/morbyd is a thin layer on top of the standard Docker Go client to easily build and run throw-away test Docker images and containers, and running commands inside them. It features a function option API to keep the slightly excessive Docker API option parameters at bay

[go-nuts] Re: go mod download fails on docker for 1.20 (but not for 1.18)

2024-02-01 Thread &#x27;TheDiveO' via golang-nuts
Are you still using Debian 11 and the outdated Debian docker.io package with Docker 18? What happens when you use a recent Docker, either 24.x or hot-off-the-press 25.0.1? And then build using a Go-Alpine base image? Do you still use Debian's broken Docker seccomp profile...? I'm on an IPv6 upl

[go-nuts] Re: Blog Article: Go Generics (and also mocking)

2024-01-09 Thread &#x27;TheDiveO' via golang-nuts
On Tuesday, January 9, 2024 at 2:28:08 AM UTC+1 Corin Lawson wrote: On Tuesday 9 January 2024 at 1:12:00 am UTC+11 TheDiveO wrote: One thing I notice is that your design assumes to specify the expected call sequence upon creation, or do I get this wrong? My expectation would be to specify this

[go-nuts] Re: Blog Article: Go Generics (and also mocking)

2024-01-08 Thread &#x27;TheDiveO' via golang-nuts
a quick first lock looks promising to me: I like the blog post, as it does IMHO a gentle introduction to your angle of attack. Having used mocking (or one of its twins/cousins/... for those who insist on this not being mocking, alas) on Python I've up to now found the Go mock packages to be d

[go-nuts] Re: How to develop with Go source code change?

2024-01-03 Thread &#x27;TheDiveO' via golang-nuts
Maybe your output is interfering with the way the go code base does some of it's checks; based on the fail in cmd/vet maybe this could be involved: https://github.com/golang/go/blob/b25f5558c69140deb652337afaab5c1186cd0ff1/src/cmd/vet/vet_test.go#L197? On Tuesday, January 2, 2024 at 5:45:12 PM U

Re: [go-nuts] unix.Select with fd gotten from named pipe on macos behaves differently compared to linux

2023-12-21 Thread &#x27;TheDiveO' via golang-nuts
gt;. To a large extend, this now excludes potential Go and/or Ginkgo/Gomega-related effects, yet is consistent with my original observation and question here. On Sunday, December 17, 2023 at 6:02:17 AM UTC+1 Kurtis Rader wrote: On Sat, Dec 16, 2023 at 7:54 AM 'TheDiveO' vi

Re: [go-nuts] unix.Select with fd gotten from named pipe on macos behaves differently compared to linux

2023-12-18 Thread &#x27;TheDiveO' via golang-nuts
n Fri, Dec 15, 2023 at 7:13 AM 'TheDiveO' via golang-nuts < golan...@googlegroups.com> wrote: I'm opening both named pipe ends as follows (in different processes): os.OpenFile(fifoname, os.O_WRONLY, os.ModeNamedPipe) os.OpenFile(fifoname, os.O_RDONLY, os.ModeNamedPipe) Pa

Re: [go-nuts] unix.Select with fd gotten from named pipe on macos behaves differently compared to linux

2023-12-18 Thread &#x27;TheDiveO' via golang-nuts
fraid, but you are not reproducing the situation I was asking for and provided a unit test for. On Sunday, December 17, 2023 at 6:16:45 AM UTC+1 Kurtis Rader wrote: I should probably clarify that my copy of TheDiveO code simply added the following function and replaced the use of github.com/si

Re: [go-nuts] unix.Select with fd gotten from named pipe on macos behaves differently compared to linux

2023-12-16 Thread &#x27;TheDiveO' via golang-nuts
that illustrates a problem of this nature. > > On Fri, Dec 15, 2023 at 7:13 AM 'TheDiveO' via golang-nuts < > golan...@googlegroups.com> wrote: > >> Hi, I need to detect on the producer side (writing end) of a named pipe >> when the consumer (reading end) ha

[go-nuts] unix.Select with fd gotten from named pipe on macos behaves differently compared to linux

2023-12-15 Thread &#x27;TheDiveO' via golang-nuts
Hi, I need to detect on the producer side (writing end) of a named pipe when the consumer (reading end) has disconnect/closed. This detection needs to work "quickly" even if the producer doesn't produce anything; thus, SIGPIPE wouldn't help. On Linux, when using unix.Select() on the fd of the p

[go-nuts] Re: go build at most 37x slower in 1.21.5 vs 1.19.3

2023-12-13 Thread &#x27;TheDiveO' via golang-nuts
IIRC the stdlib isn't delivered precompiled anymore since 1.20. You should make sure to have layer caching in place in case you want to tune your pipelines. You can do a "go build std" IIRC. On Wednesday, December 13, 2023 at 4:40:21 PM UTC+1 Lib Martinito wrote: > > [image: Screenshot 2023-12-

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

2023-12-10 Thread &#x27;TheDiveO' via golang-nuts
You basically already showed how to do it on Linux: inside your Go prog, you know the file descriptor number (f.Fd()). Then do an os.Readlink(fmt.Sprintf("/proc/self/fd/%d", f.Fd()) and check the result (if no error) with strings.HasSuffix(link, "(deleted)"). On Sunday, December 10, 2023 at 5:4

Re: [go-nuts] Re: Clace: Secure web application development platform using Starlark

2023-10-30 Thread TheDiveO
Unfortunatelly, "okay" hasn't been tested in court yet and especially with HashiCorp breaking bad you surely have the deep pockets to see this through? On Tuesday, October 31, 2023 at 4:12:13 AM UTC+1 Dan Kortschak wrote: > On Mon, 2023-10-30 at 18:43 -0700, Jason E. Aten wrote: > > I'm surprise

[go-nuts] Re: Clace: Secure web application development platform using Starlark

2023-10-30 Thread TheDiveO
sadly, OpenDoufu(*) is the epitaph of HashiCorp breaking bad. So that go-plugin package is a no-go now (pun intended). (*) I can't get myself using the British Empire misspelling of Standard Chinese (putonghua). And don't call that Ma... either. On Monday, October 30, 2023 at 7:54:50 PM UTC+1 J

[go-nuts] Re: URL variables with net/http

2023-10-19 Thread TheDiveO
stdlib only with upcoming 1.22 which isn't yet released, see https://eli.thegreenplace.net/2023/better-http-server-routing-in-go-122/ gorilla mux is another 3rd party muxer with variable support https://github.com/gorilla/mux the "best" way using only stdlib mux is to parse the path and extract

[go-nuts] Re: go list fails, how do I clear "-mod=readonly"

2023-10-16 Thread TheDiveO
looks like https://stackoverflow.com/questions/76495283/go-list-command-prints-hint-i-dont-understand On Monday, October 16, 2023 at 7:25:46 PM UTC+2 Pat Farrell wrote: > On Monday, October 16, 2023 at 1:22:42 PM UTC-4 TheDiveO wrote: > > go mod tidy > > > I've done

[go-nuts] Re: go list fails, how do I clear "-mod=readonly"

2023-10-16 Thread TheDiveO
go mod tidy On Monday, October 16, 2023 at 7:20:13 PM UTC+2 Pat Farrell wrote: > i'm running > go version go1.20.5 linux/amd64 > > when I attempt to run 'go list' to find any updated to dependant > modules, it fails. > > go list -m -u all > go: updates to go.sum needed, disabled by -mod=readonly

Re: [go-nuts] the environment variable GOROOT doesn't load for work with go

2023-10-07 Thread TheDiveO
please simply follow the official installation instructions here, https://go.dev/doc/install, and select the Windows tab. This will set up everything correctly, avoiding the trouble you might have gotten into by installing individual bits and pieces into directories there they do not belong to

Re: [go-nuts] Re: Is it expected that signal.NotifyContext() changes the execution thread?

2023-10-01 Thread TheDiveO
It works until it doesn't. On Sunday, October 1, 2023 at 8:37:08 AM UTC+2 Kurtis Rader wrote: > On Sat, Sep 30, 2023 at 12:23 AM TheDiveO wrote: > >> Did you explicitly lock the initial OS thread, aka M0, to the >> main/initial go routine by calling runt

Re: [go-nuts] About variables have per-iteration scope instead of per-loop scope

2023-10-01 Thread TheDiveO
; subject would be the variable and the rules for implicit or tacit subject > would be the scope. People may wonder. Again... I guess time will answer us > all. > > Greetings > > El sábado, 30 de septiembre de 2023 a las 16:55:24 UTC-3, TheDiveO > escribió: > >> Switchi

Re: [go-nuts] About variables have per-iteration scope instead of per-loop scope

2023-09-30 Thread TheDiveO
Switching between human languages, such as for me, German and English, required me to learn English at a level that I think in it. Even with their shared ancestry, I don't expect these languages to use the same structure and concepts, like loop variable scoping. Admittedly, Go doesn't allow me

[go-nuts] Re: Is it expected that signal.NotifyContext() changes the execution thread?

2023-09-30 Thread TheDiveO
Did you explicitly lock the initial OS thread, aka M0, to the main/initial go routine by calling runtime.LockOSThread() from main or an init func? I suspect you were lucky in the past, but I might be wrong. On Saturday, September 30, 2023 at 5:20:47 AM UTC+2 Kurtis Rader wrote: > I was rewriti

Re: [go-nuts] Re: Help with WASM performance

2023-09-23 Thread TheDiveO
The cynic in me notes the use of "aims". IIRC is single-threaded, do you know if your code is single- threaded too, or does it use several core for decoding? On Saturday, September 23, 2023 at 7:37:13 AM UTC+2 Stephen Illingworth wrote: > Comparison to native speeds is the key attraction of W

Re: [go-nuts] x/mobile: avoid to catch sigabort signal

2023-09-11 Thread TheDiveO
CMAC_resume might be something from here, IIRC Darwin's OpenBSD anchestry: https://man.openbsd.org/CMAC_Init.3 On Monday, September 11, 2023 at 8:17:44 AM UTC+2 Kurtis Rader wrote: > On Sun, Sep 10, 2023 at 10:41 PM Danilo bestbug > wrote: > >> Hey Robert, >> The problem is not reproducible in

Re: [go-nuts] x/mobile: avoid to catch sigabort signal

2023-09-10 Thread TheDiveO
Maybe this SO Q with A might also help with further details: https://stackoverflow.com/questions/47869988/how-does-cgo-handle-signals On Friday, September 8, 2023 at 11:38:38 PM UTC+2 Danilo bestbug wrote: > Ehy Ian, thanks for the response. Apology if I was not clear, I try to > explain in a d

Re: [go-nuts] x/mobile: avoid to catch sigabort signal

2023-09-09 Thread TheDiveO
You seem to be barking up the wrong tree, at least for the moment. Maybe your team may want to learn more about cgo and by sheer coincidence there's a blog post https://shane.ai/posts/cgo-performance-in-go1.21/ that might serve as a starting point, with one or two pointers to go further. I als

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

2023-08-25 Thread TheDiveO
==? On Friday, August 25, 2023 at 4:44:02 PM UTC+2 محمد بومنذر wrote: > Greetings everyone, > > I'm writing a parser based on Go's `encoding/xml`, I tried to use the > following pattern but it was deemed invalid: > > ``` > switch tok := p.tok.(type) { > case xml.StartElement, xml.EndElement: > t

Re: [go-nuts] How to be a good slog module?

2023-08-24 Thread TheDiveO
ave a preference for a different frontend. > > - sean > > > On Wed, Aug 23, 2023 at 7:09 PM TheDiveO wrote: > >> Up front, I admit my sin of arrogance in giving structured logging the >> slip these past years and misusing logrus just as a text logger with >> mult

[go-nuts] How to be a good slog module?

2023-08-23 Thread TheDiveO
Up front, I admit my sin of arrogance in giving structured logging the slip these past years and misusing logrus just as a text logger with multiple log levels. This question is kind of my atoning... For preparation, I've read through (today's?) Go slog blog post, as well as some comparably rec

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

2023-08-23 Thread TheDiveO
ce” is pretty funny. But you’re spot on. > > On Aug 20, 2023, at 2:51 AM, TheDiveO wrote: > > That education place has never talked to any employer, that's what their > list suggests. It's not about the items on this list. It won't ever > correct. But it i

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

2023-08-20 Thread TheDiveO
well, our "(major) engineering orgs" leave the choice of IDE to our devs. Devs have different styles, so as long as they meed the demand, who cares. On Saturday, August 19, 2023 at 11:17:35 PM UTC+2 Robert Engels wrote: > Reread what I wrote. Vim with autocomplete, etc is not a simple text > ed

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

2023-08-20 Thread TheDiveO
That education place has never talked to any employer, that's what their list suggests. It's not about the items on this list. It won't ever correct. But it is basically saying that with one or a few more classes you're ready for your job. That's marketing selling. Depending on the job there's

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

2023-08-19 Thread TheDiveO
Well, the title about something "best" is probably making most skip it. Best is highly subjective. Also your list seems to include IDEs that to my knowledge don't have Go support at all, but I might be mislead here. I don't understand what seems to be yourreal question at the end, do you wan

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

2023-08-19 Thread TheDiveO
Nothing better than an IBM card puncher as my IDE! On Saturday, August 19, 2023 at 11:38:33 AM UTC+2 Jan Mercl wrote: > 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 proph

Re: [go-nuts] Why is foo in my go.sum file?

2023-08-18 Thread TheDiveO
test case? On Friday, August 18, 2023 at 9:18:05 AM UTC+2 Dan Kortschak wrote: > On Fri, 2023-08-18 at 16:49 +1000, Nigel Tao wrote: > > The go.sum file in the golang.org/x/image repo has a line that is not > > another golang.org.x/* module: > > > > github.com/yuin/goldmark v1.4.13/go.mod > > h1

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

2023-08-18 Thread TheDiveO
the common case for >> projects with integration tests (because everyone has also unit tests). And >> a suggestion of maybe a mention / an example in the >> integration-test-coverage >> blog <https://go.dev/blog/integration-test-coverage> ? >> >> On Wed

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

2023-08-16 Thread TheDiveO
of creating a temporary > directory (or extract it from the go tool) , where for unit tests only it's > not needed ... I wonder if this is done deliberately, or just a bug ? > > cheers > > On Wednesday, August 16, 2023 at 8:33:23 PM UTC+2

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

2023-08-16 Thread TheDiveO
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.dev/blog/integration-test-coverage

Re: [go-nuts] What does "shallow clone" mean?

2023-08-11 Thread TheDiveO
Personally, I find the source https://cs.opensource.google/go/x/exp/+/352e893a:maps/maps.go;l=65 to be helpful in quickly answering such questions. On Friday, August 11, 2023 at 4:36:50 PM UTC+2 Ian Lance Taylor wrote: > On Fri, Aug 11, 2023, 7:28 AM shinya sakae wrote: > >> maps package was r

Re: [go-nuts] binary.ByteOrder

2023-08-10 Thread TheDiveO
https://github.com/google/nftables/blob/main/binaryutil/binaryutil.go ... could give you some bad ideas; we need it for Linux nftables that encodes stuff in host endianess. On Thursday, August 10, 2023 at 3:27:49 PM UTC+2 Stephen Illingworth wrote: > Thanks. Although I'm not worried about the n

Re: [go-nuts] Bets approach for test helper packages within same project

2023-08-07 Thread TheDiveO
https://stackoverflow.com/a/54734212 On Monday, August 7, 2023 at 8:48:24 AM UTC+2 josvazg wrote: > Interesting! Thanks! > > I was assuming wrongly the module was the unit of compilation. > > If any package not imported by production code is not included, then that > also means that build tags a

Re: [go-nuts] Realpath?

2023-08-04 Thread TheDiveO
s "root" elements in particular. In case someone wants to know more, here we are: https://github.com/thediveo/procfsroot ... I'm using this to access the VFS view of containers without needing to spawn new processes, switching them into container mount namespaces, and then all the has

Re: [go-nuts] Realpath?

2023-08-04 Thread TheDiveO
As I couldn't figure this out from the repo's documentation: what's the difference and what's the benefit compared to stdlib https://pkg.go.dev/path/filepath#EvalSymlinks? On Thursday, August 3, 2023 at 8:57:08 PM UTC+2 Carlos Henrique Guardão Gandarez wrote: > Hey there! > > I created a new l

Re: [go-nuts] Error handling

2023-08-02 Thread TheDiveO
g and productive to those types of devs and/or types of Go modules, that is, applications. On Wednesday, August 2, 2023 at 9:27:23 PM UTC+2 TheDiveO wrote: > > Ben Hoyt's blog post Scripting with Go: a 400-line Git client that... > <https://benhoyt.com/writings/gogit/> menti

Re: [go-nuts] Error handling

2023-08-02 Thread TheDiveO
Ben Hoyt's blog post Scripting with Go: a 400-line Git client that... mentions error handling from a perspective that made me clear for the first time why I'm always in two minds when it comes to Go's error handling: 1. the perspective of a prod-code pa

[go-nuts] Re: Any option to substitute plug-in package ?

2023-08-02 Thread TheDiveO
ality. Personally, I find the shared libs to be finicky and haven't yet done a real project that needed this variant (but I wrote a go-plugger <https://github.com/thediveo/go-plugger> module as an example). 3. statically binary-builtin plugins: this actually is what I te

[go-nuts] Re: I made a CLI tool, and I'm curious about your ideas

2023-08-02 Thread TheDiveO
Fresh from the Go project itself. *Experimenting with project templates:* https://go.dev/blog/gonew On Friday, July 14, 2023 at 10:05:34 AM UTC+2 Marcello H wrote: > No matter what other people say, as a first project, I think it is great > because it gives you the opportunity to practise how

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

2023-07-24 Thread TheDiveO
just a wild guess: search for prior art? On Tuesday, July 25, 2023 at 1:21:22 AM UTC+2 Ian Lance Taylor wrote: > On Mon, Jul 24, 2023 at 3:08 PM Bravo Moua wrote: > > > > How can one search for packages dating back to Jan 2009 > > Well, Go was only publicly released in November, 2009, so there a

[go-nuts] Re: RPI

2023-07-20 Thread TheDiveO
The download page offers ARM 64bit and v6(l) architecture tar balls. v6l is probably the 32bit architecture. You don't mention your OS and architecture (lsb_release -a), but armv7l sounds like an old rpi 2 with only 32bit support. So you might give the v6l version a try. Otherwise, you'll need

[go-nuts] Re: Package structure & testing

2023-06-18 Thread TheDiveO
Maybe not the best way either, but the POD part might benefit from slight refactoring and you already in part hinted at it. - gopher/api -- some PODs here - gopher/model -- don't repeat gopher as in gophermodel; some PODs here It won't ever perfect, so YMMV. But at the same time it allows

Re: [go-nuts] No DNS TTL information in net.LookupSRV()

2023-05-28 Thread TheDiveO
would https://pkg.go.dev/github.com/miekg/dns be an option instead of the std lib? On Friday, May 26, 2023 at 9:45:37 PM UTC+2 Varun Ahluwalia wrote: > Is there a TTL support in GoLang DNS, or if it was implemented in a later > release, please suggest. > Thanks, > > On Saturday, October 8, 2016

Re: [go-nuts] Re: go mod download fails on docker for 1.20 (but not for 1.18)

2023-05-22 Thread TheDiveO
n -it golang:1.20-buster sh -c "ip -4 addr show dev eth0; ip -4 > route show" > 52: eth0@if53: mtu 1500 qdisc noqueue > state UP group default link-netnsid 0 > inet 172.17.0.2/16 brd 172.17.255.255 scope global eth0 >valid_lft forever preferred_lft forever >

[go-nuts] Re: go mod download fails on docker for 1.20 (but not for 1.18)

2023-05-21 Thread TheDiveO
? base system distribution? ? do you have IPv6 connectivity at all? ? which docker version? On Monday, May 22, 2023 at 2:29:08 AM UTC+2 Joao Miguel Ferreira wrote: > Hello all, > > My docker build is ok with FROM golang:1.18-alpine, FROM > golang:1.18-buster and FROM golang:1.18-bullseye images.

[go-nuts] Re: Adding extra files to an already compiled binary using embed.FS

2023-05-11 Thread TheDiveO
What about merging two io.FS instance? A quick search positively surprises me, as there's https://pkg.go.dev/github.com/yalue/merged_fs for this already existing. So you could benefit from the build cache and yet add something later by merging/fusing multiple io.FS instances at runtime, from di

[go-nuts] How To: use your local workspace in staged container image build...

2023-05-06 Thread TheDiveO
doable, albeit with some limitations due to the Dockerfile syntax. So, here we are and I would like to ask kindly for kind feedback ... also available as a gist <https://gist.github.com/thediveo/0d8b6ae7f88918c2571890e508468b23>. The illustrative example assumes a filesystem setup a

Re: [go-nuts] FATAL: ThreadSanitizer: unsupported VMA range FATAL: Found 39 - Supported 48 / go: added github.com/docker/docker v23.0.4+incompatible

2023-04-26 Thread TheDiveO
> >> https://github.com/moby/moby/archive/refs/tags/v23.0.4.tar.gz >> >> from the moby repository : https://github.com/moby/moby >> >> but I don't know what to do next. I don't see the instructions there. Can >> you point me to the right tutorial ?

Re: [go-nuts] FATAL: ThreadSanitizer: unsupported VMA range FATAL: Found 39 - Supported 48 / go: added github.com/docker/docker v23.0.4+incompatible

2023-04-25 Thread TheDiveO
Please do not install Docker as a snap, as this fundamentally breaks several parts of Docker. This is a well known limitation of snap. Simply install from the Docker repository, instructions are on the Docker website. Building Docker is complicated, as it predates Go modules and still has no fu

[go-nuts] Re: Reduce memory usage via reduced padding?

2023-04-18 Thread TheDiveO
...would immediately *negatively affect* workhorses... On Tuesday, April 18, 2023 at 8:26:27 PM UTC+2 TheDiveO wrote: > The standard libraries in several parts define and also use structs where > the field ordering and padding is crucial as they are shared with operating > system

[go-nuts] Re: Reduce memory usage via reduced padding?

2023-04-18 Thread TheDiveO
The standard libraries in several parts define and also use structs where the field ordering and padding is crucial as they are shared with operating system functions. Trying to rearrange fields in 3rd party apllications would immediately workhorses like Docker container engine, with associated

[go-nuts] httptest.ResponseRecorder and superfluous WriteHeader calls

2023-03-22 Thread TheDiveO
While maintaining my Go spaserve <https://github.com/thediveo/spaserve> module for serving single-page applications with client-side DOM routing and on different routes simultaneously I noticed different logging behavior between http.timeoutWriter.WriteHeader <https://cs.opensource.

[go-nuts] Re: How to constraint type parameter not pointer

2023-03-18 Thread TheDiveO
How could I forget https://github.com/samber/mo...? On Saturday, March 18, 2023 at 7:00:03 PM UTC+1 TheDiveO wrote: > Maybe (no pun intended) implementations like > https://github.com/OlegStotsky/go-monads and > https://github.com/TeaEntityLab/fpGo can shed some more light on your &

[go-nuts] Re: How to constraint type parameter not pointer

2023-03-18 Thread TheDiveO
Maybe (no pun intended) implementations like https://github.com/OlegStotsky/go-monads and https://github.com/TeaEntityLab/fpGo can shed some more light on your question and implementation designs? On Saturday, March 18, 2023 at 11:37:59 AM UTC+1 李晓辉 wrote: > When I want to implement a Maybe[T

[go-nuts] Re: alignment of stack-allocated variables?

2023-03-06 Thread TheDiveO
0 B/op 0 allocs/op BenchmarkEnc-8 10 6.327 ns/op 0 B/op 0 allocs/op This now gets within 6% of the unsafe method. On Saturday, March 4, 2023 at 3:53:42 PM UTC+1 TheDiveO wrote: > Keith, thank you very much for your feedback, it is highl

[go-nuts] Re: alignment of stack-allocated variables?

2023-03-04 Thread TheDiveO
rickiness around making sure that > calls can be resolved and inlined. > > b := make([]byte, 4) > buf.Read(b) > if little { // some global variable (or constant) you set >return binary.LittleEndian.Uint32(b) > } > return binary.BigEndian.Uint32(b) > On Friday, March 3

[go-nuts] alignment of stack-allocated variables?

2023-03-03 Thread TheDiveO
In dealing with Linux netlink messages I need to decode and encode uint16, uint32, and uint64 numbers that are in an arbitrary aligned byte buffer in an arbitrary position. In any case, these numbers are in native endianess, so I would like to avoid having to go through encoding/binary. buff :=

Re: [go-nuts] Go 1.20 "cold start" slows down CI pipeline stages due to first building stdlib

2023-02-16 Thread TheDiveO
Many thanks! -- 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.go

[go-nuts] Go 1.20 "cold start" slows down CI pipeline stages due to first building stdlib

2023-02-16 Thread TheDiveO
nergy consumption. For instance, a small module https://github.com/thediveo/caps/actions/runs/4197604787 takes around 36s for Go 1.19 versus Go 1.20 with 63s (times for "go test" phase only). Now I'm curious: is there some way to "preheat" Go 1.20 in order to cach

Re: [go-nuts] Creating and Linking to Shared Library Version of Go Runtime? (with possible solution)

2023-02-02 Thread TheDiveO
If I read the 1.20 release notes correctly, there has been a change with how the compiled std lib not only is delivered (not anymore) and cached, so that it now ends up in the module cache. Maybe you can retry your experiments with 1.20 if this now works without the slightly ugly workarounds?

Re: [go-nuts] Creating and Linking to Shared Library Version of Go Runtime? (with possible solution)

2023-01-31 Thread TheDiveO
> So, the solution to problem #1 is to make sure a normal user can create /usr/local/go/pkg/linux_amd64_dynlink and files in and underneath it. While this is fine as a proof of concept and to diagnose the situation, I don't think that it can be called good advice to make /usr/local writeable to

Re: [go-nuts] Creating and Linking to Shared Library Version of Go Runtime?

2023-01-29 Thread TheDiveO
Are the std/runtime .so's even versioned? How do you manage that? Every time I'm feeling like finally being in $PARADISE out of the .so dependency $VERYVERYHOTPLACE there comes along the demand to go back. Sigh. ;) On Sunday, January 29, 2023 at 9:26:51 PM UTC+1 bobj...@gmail.com wrote: > I'm

Re: [go-nuts] Go routine as realtime thread without preemption?

2023-01-22 Thread TheDiveO
go routine scheduling. Cheers, TheDiveO -- 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 discus

Re: [go-nuts] Go routine as realtime thread without preemption?

2023-01-22 Thread TheDiveO
from GOMAXPROCS that LockOSThread does not exclude locked go routine. Yet I'm intrigued to learn more, so can you please elaborate more? Thank you very much! TheDiveO -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

[go-nuts] Go routine as realtime thread without preemption?

2023-01-21 Thread TheDiveO
When a go routine gets locked to an OS thread, does the Go runtime scheduler then stops interrupting this Go routine, so when this Go routine (or rather the thread) gets pinned to an exclusive CPU core can make use of real time priorities? -- You received this message because you are subscribe

Re: [go-nuts] How can I use go with Modules

2022-12-02 Thread TheDiveO
My 2cents here. One of the most terrible examples of pre-mod repos I've encountered are Docker's engine repos, subsuming also the repos moved into the moby realm: they mostly lack module information and they break upon checking them out on master or go getting them and trying to build, even on

[go-nuts] Re: [ANN] new linter for "mixed pointer and value receivers"

2022-12-02 Thread TheDiveO
IMHO it might be of broader use to lint the cases where a value receiver is used and there are assignments to it or its fields ... or is this already caught by ineffassign? The recommendation leads to slightly "ugly" situations on a regular basis to enforce a pointer receiver on the Stringer me

[go-nuts] Re: Problems with array slicing reliability?

2022-11-24 Thread TheDiveO
On Wednesday, November 23, 2022 at 10:57:03 PM UTC+1 loji...@gmail.com wrote: > [...] I am using an AMG64 computer with Windows 10, and *Go version > 0.36.0.* [*emphasis mine*] > Go version 0.36.0? Really? -- You received this message because you are subscribed to the Google Groups "golang-

Re: [go-nuts] Re: clarifying Go FAQ: Is Go an object-oriented language?

2022-11-24 Thread TheDiveO
Reading the "yes and no" part as a newcomer to Go actually made me snigger and I though that this kind of answer shows a thorough and differentiated thinking not shy of dealing with complexity as it is without trying to flee into simple and useless label simplification. IMHO the problem is not

Re: [go-nuts] Re: Unicode variable name error

2022-11-08 Thread TheDiveO
I've always wondered how to deal with exported versus unexported identifiers in scripts like Chinese? On Sunday, November 6, 2022 at 3:08:59 PM UTC+1 ba...@iitbombay.org wrote: > In Indic scripts in certain contexts you have to use a vowel sign for the > typography to make sense; you can’t use

  1   2   >