: 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 at 10:44:14 UTC+1 Pet
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
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 _
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
:
>
>> 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, October 11, 2023 at 12:32:
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
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
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
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
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:
>
>>
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
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:
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
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 Windows DLL,
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
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
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,
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:20AM -0700, Pe
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
>
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
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
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
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
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
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
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
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
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
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
ber 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:
>
>
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
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
>
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,
33 matches
Mail list logo