1, 2024 at 12:29 AM Peter Galbavy
> wrote:
> >
> > They are created by the VS Code terminal session before I run my
> program. Their open flags are not known to me or under my control, but I
> guess they don't have close-on-exec set.
> >
> > I would not that i
.
As mentioned, I've worked around my specific issue by walking all FDs (>2)
and setting their ExtraFiles slot to nil, rather then the field itself left
as nil.
On Friday 8 November 2024 at 19:03:43 UTC Ian Lance Taylor wrote:
> On Fri, Nov 8, 2024 at 2:18 AM Peter Galbavy wrote:
>
(yes, the above code is dumb and I have squashed it, to just keep the max
fd without a slice ... it just started out with something else)
On Friday 8 November 2024 at 10:39:12 UTC Peter Galbavy wrote:
> Having added this, the child process now does not inherit those FDs:
>
> //
wise) or am I just doing the original
cmd.Start() wrong?
On Friday 8 November 2024 at 10:18:27 UTC Peter Galbavy wrote:
> I have a command line manager tool that builds the starting environment
> for a process and calls cmd.Start().
>
> The code sets (doesn't need to as it start
I have a command line manager tool that builds the starting environment for
a process and calls cmd.Start().
The code sets (doesn't need to as it starts as nil, but does to be extra
explicit) cmd.ExtraFiles = nil, but even then I seem to inherit a bunch of
FDs from the CLI - I noticed because t
Makes sense and good to know, but for diag output is there any way to turn
it off?
On Friday 13 September 2024 at 14:25:19 UTC+1 Eli Lindsey wrote:
> Those are sizes from chunked encoding.
>
> -eli
>
> On Sep 13, 2024, at 9:10 AM, Peter Galbavy wrote:
>
> I am trying
I am trying to add some low level tracing to a client app to validate the
responses coming from a SaaS platform.
When I use either http's resp.Write(os.Stderr) or
httputil.DumpResponse(resp, true) I see a hex content length immediately
before the body and a literal "0" on a line after,
i.e. us
urday 15 June 2024 at 12:01:40 UTC+1 Tobias Klausmann wrote:
> Hi!
>
> On Sat, 15 Jun 2024, Peter Galbavy wrote:
> > If end binary size is a constraint, try "upx" to compress the end
> binary. I
> > regularly get 3x compression - but lose all debug options, ob
If end binary size is a constraint, try "upx" to compress the end binary. I
regularly get 3x compression - but lose all debug options, obviously. Works
on most OSes for executables.
On Friday 14 June 2024 at 22:43:53 UTC+1 Tony M wrote:
> Thank you to github.com/jondot/goweight I was able to de
Another thumbs up! Thanks
On Tuesday 21 May 2024 at 16:16:54 UTC+1 Zxilly Chou wrote:
> Hello go-nuts,
>
> I'm excited to share a new tool that has landed in our Go ecosystem:
> go-size-analyzer. This utility is designed to give you a clear picture of
> the size of your compiled Go binaries, wi
I could really have used the go-xmlstruct a year ago :-) But, if I need to
fill in more blanks I will try it!
On Thursday 25 April 2024 at 02:24:45 UTC+1 twp...@gmail.com wrote:
> You can parse XML and JSON quickly with these tools:
>
> https://github.com/twpayne/go-xmlstruct
> https://github.co
December 2023 at 09:06:00 UTC Brian Candler wrote:
> [a:b] gives you the elements from a to b-1 inclusive. So if you want the
> pair at position x, it has to be [x:x+2]
>
> https://go.dev/play/p/3nvEfOjdfnj
>
> On Thursday 14 December 2023 at 08:38:57 UTC Peter Galbavy wrote:
>
I noticed today that the regexp docs read:
If 'Index' is present, matches and submatches are identified by byte index
pairs within the input string: result[2*n:2*n+2] identifies the indexes of
the nth submatch.
I think that should be result[2*n:2*n+1] - at least in my code that's how
it is wo
Check the size of dependencies;
>From
>https://stackoverflow.com/questions/70764915/how-to-check-the-size-of-packages-linked-into-my-go-code
>
the very last answer suggests:
go tool nm -size -sort size EXECUTABLE
Which has helped me locate unexpected lumps of imports. You can also build
with
Hang on - I missed your original statement that you are building
*libraries* yourself. I am building executables. Sorry for the confusion
and my too-fast scan reading!
On Wednesday, 11 October 2023 at 12:08:53 UTC+1 Peter Galbavy wrote:
> If you link statically, e.g. from my Dockerf
Jan wrote:
>
>> Thanks Peter, but I don't follow ... I also use docker to build the
>> pre-built binaries.
>>
>> But how do you distribute them, so folks using your library don't think
>> to install them ?
>>
>> On Wednesday, O
I use a docker container (golang:bullseye seems the most compatible) and
build static binaries. This is feasible as long as your dependencies do not
require dynamic loading of dependencies.
Poor (my Dockerfile skills) example
here: https://github.com/ITRS-Group/cordial/blob/main/Dockerfile
Pet
You will need to create a custom type and unmarshal method. Plenty of
example if you search for "golang custom json unmarshal".
As I've only had to implement it for a couple of simple types I can't offer
my own valid example.
On Thursday, 14 September 2023 at 14:36:12 UTC+1 Tobias Klausmann wro
RCH.
>
> Aside: finding a comprehensive list of GOOS and GOARCH values is a bit
> tricker. You can run "go tool dist list", or there are third-party
> summaries like
> https://gist.github.com/asukakenji/f15ba7e588ac42795f421b48b8aede63
>
> On Thursday, 31 August 2023 a
ursday, 31 August 2023 at 10:13:12 UTC+1 Brian Candler wrote:
> https://github.com/golang/go/issues/51572
>
> On Thursday, 31 August 2023 at 08:57:15 UTC+1 Peter Galbavy wrote:
>
>> I have used comment level build constraints for a while but I moved to
>> using _linux.
I have used comment level build constraints for a while but I moved to
using _linux.go and _windows.go over time as it makes it clearer for
external viewing.
A user reported they tried to build on MacOS and of course this didn't
work. I renamed the _linux.go files to _unix.go suffixes but then
I use a docker container with a centos7 image and build my shared libs
there;
https://github.com/ITRS-Group/cordial/blob/4f119f7893c67b817baaad23ed75b1ba134bf9c2/Dockerfile#L35
(pls don't judge my Dockerfile skills, it's a learning experience ;) )
On Thursday, 10 August 2023 at 11:12:23 UTC+1 f
As a slight digression - I thought I was going mad, but 'slices' and 'maps'
are new :-) Only in 1.21 though...
Well, there is a lot of boiler plate that maps.Keys() will get rid of.
On Thursday, 13 July 2023 at 10:06:01 UTC+1 Brian Candler wrote:
> Structs are already comparable, but all fields
Yes, setsid combined with cmd.Process.Release() works for me.
My local / specific needs code
is
https://github.com/ITRS-Group/cordial/blob/ad18bfbfa44eff1b9b66408394dd83749da25bb1/pkg/process/process.go#L64
which works well for everything I have thrown at it (on Linux).
On Wednesday, 5 July 2
I can see a use - exporting an embedded FS (read only) from a binary,
especially for testing stuff.
On Thursday, 29 June 2023 at 08:00:18 UTC+1 Roland Müller wrote:
> Hello,
> I am struggling to understand the purpose of extension.
> FS is an interface to access file systems from go code. Is yo
FindAllStringSubmatch()
? https://pkg.go.dev/regexp#Regexp.FindAllStringSubmatch
On Friday, 10 February 2023 at 12:52:34 UTC Jochen Voss wrote:
> Dear all,
>
> What happens if a group in a regular expression matches repeatedly, via
> the * operator? Experimentally I found that FindStringSubmat
Also, if you are concerned about the availability of the packages in the
future, use vendoring to pull in a copy of the sources to the
repo: https://go.dev/ref/mod#go-mod-vendor
Peter
On Monday, 5 December 2022 at 13:35:25 UTC Brian Candler wrote:
> On Monday, 5 December 2022 at 13:12:26 UTC l
If you look in the http.Request passed to your handler, there is a URL
field - use the net/url package to pull this out:
https://pkg.go.dev/net/url#URL
On Wednesday, 16 November 2022 at 09:08:38 UTC squadglad...@gmail.com wrote:
> Hello Everyone,
>
> I'm developing a http server using inbuilt h
I also use a flag to do this, and I have a local package that then removes
this flag (or any of a defined list) before re-execing the binary:
https://github.com/ITRS-Group/cordial/tree/main/pkg/process
https://pkg.go.dev/github.com/itrs-group/cordial/pkg/process#Daemon
It may not be perfect, bu
Thanks for the detail. We cannot change the calling program, just conform
to it's API, so it's one function call per email send event and each in
it's own (new) thread.
On Thursday, 20 October 2022 at 12:28:12 UTC+1 Konstantin Khomoutov wrote:
> On Wed, Oct 19, 2022 at 06:28
I have built a shared lib in Go to replace an old thing we use to send
email - mainly to modernise things and add TLS and authentication. We run
each call to the entry point in it's own thread in the main program.
I am both curious but also concerned about what happens here with go
runtimes. I
We have a different requirement, which is opaquing of credentials in user
visible config files. The company I work for has a basic way of doing this
in the "real" product and I followed the same model for compatibility.
There is, as yet, no auto rotation.
Basically, we generate an OpenSSL "comp
Oh, hang on, please ignore my last message. It's that was because the
*caller* was defined that way - it's NOT a Go thing. Oops, my bad.
Peter
On Thursday, 29 September 2022 at 10:33:23 UTC+1 Peter Galbavy wrote:
> On Linux at least - I have not tried building or using a Win
On Linux at least - I have not tried building or using a Windows DLL, you
have to accept C-style args and process them in the exported function
signature:
e.g.
//export SendMail
func SendMail(n C.int, args **C.char) C.int {
conf := parseArgs(n, args)
...
Here my parseArgs() func loops over
A good starting point is to look for a multiplxer / multiplexor
On Saturday, 17 September 2022 at 11:59:11 UTC+1 ramki...@hotmail.com wrote:
> I have a tcp server that collects jobs (lets say 10), and tcp clients get
> the jobs. This is done in a FIFO method, where the first job the server
> ge
When you use
cmd, err := exec.Command(...)
you then set-up it's environment before execution by setting cmd.Env:
cmd.Env = append(os.Environ(), `PATH="..."`)
and only then run the command:
out, err := cmd.Output()
if err ... { ... }
fmt.Println("output:", out)
The above mostly from
If it helps, I put this together for my own project - it's not a package
but a bunch of convenience functions/methods for generating TLS certs and
keys (there is a lot of implementation specific stuff), but the general
shape may help you:
https://github.com/itrs-group/cordial/blob/main/tools/ge
Thanks for setting my mind at ease.
On Wednesday, 22 June 2022 at 16:05:17 UTC+1 axel.wa...@googlemail.com
wrote:
> No, there is no way to do it. You have to make a copy of the slice as you
> did.
>
> On Wed, Jun 22, 2022 at 4:58 PM Peter Galbavy
> wrote:
>
>> Thi
This is probably an FAQ but...
I've tried to understand this before but gave up; I am trying to (quick and
dirty) import from a CSV or Excel file to a DB and I would like to take the
slice from csv.Read() and just pass it through to stmt.Exec() but because
the first is a []string and the second
It's worth noting that @latest only works for "releases" and not for
tags/releases labelled pre-release. Just in case anyone hits the same issue
I did a while back! :)
On Wednesday, 25 May 2022 at 07:40:04 UTC+1 Volker Dobler wrote:
> If you want the command to be installed: Why don't you insta
I am neither enough of a Go expert ("yet) - I hope) or good enough in real
math to say much apart from that is actually one of the clearest
explanations of P/NP problems and the actual meaning of CNF/DNF that I have
had the pleasure to read. Even setting aside the importance to the design
decis
Rather than overthink it at this stage, just use bufio.Scanner and
strings.Contains() and see what performance is like. I suspect that for a
plain string and a large-ish file it will be about as good as it gets.
On Sunday, 8 May 2022 at 09:36:15 UTC+1 Tamás Gulácsi wrote:
> If that "100s of MB
42 matches
Mail list logo