[go-nuts] problems using external modules with go 1.16.4

2021-05-07 Thread natxo....@gmail.com
hi, I am struggling with the new go version. I have a simple script that imports a github module, and before (don't know which go version) I could just run: go get github/user/module and then in my crappy script I could package main import github.com/user/module func main() { p := module

Re: [go-nuts] problems using external modules with go 1.16.4

2021-05-07 Thread natxo....@gmail.com
On Friday, May 7, 2021 at 3:34:14 PM UTC+2 Jan Mercl wrote: > On Fri, May 7, 2021 at 3:21 PM natxo....@gmail.com > wrote: > > > I do not want to write a module, I just want to use a module. So how do > I do this? I am reading all the tutorials listed on the go help modules

[go-nuts] unpacking map[string]interface{} answer

2021-05-30 Thread natxo....@gmail.com
hi, I am struggling to understand how to use this map[string]interface{}. snippet: package main import "fmt" import "github.com/mattwilmott/go-foreman" func main() { client := foreman.Client("foreman.l.example.org", "admin", "whatever", false, "") fmt.Println(client) resp, err :=

[go-nuts] Re: unpacking map[string]interface{} answer

2021-05-30 Thread natxo....@gmail.com
rr) } fmt.Printf("%T\n", resp) and the result is: map[string]interface {} so this is my problem, I don't know what for type in resp is :?. I'll take a look a the external library.. Thanks! On Monday, May 31, 2021 at 12:47:36 AM UTC+2 natxo@gmail.com wrot

[go-nuts] Re: unpacking map[string]interface{} answer

2021-05-31 Thread natxo....@gmail.com
Compute_attributes.Corespersocket m string ~Compute_attributes.Cpus m string ~Compute_attributes.Start m string Thanks for your pointer. Regards, Natxo On Monday, May 31, 2021 at 6:45:36 AM UTC+2 natxo@gmail.com wrote: > hi, > > I

[go-nuts] json unmarshalling troubles

2021-06-02 Thread natxo....@gmail.com
hi, I have this json back from an api: { "all_parameters": [{ "priority": 60, "created_at": "2021-06-02 12:15:13 UTC", "updated_at": "2021-06-02 12:15:13 UTC", "id": 28, "name": "network_interface_mapping", "parameter_typ

[go-nuts] Re: json unmarshalling troubles

2021-06-03 Thread natxo....@gmail.com
hi all, thanks for your insights. The Value interface{} type does work nicely. I had tried as well the map[string]interface{} route, and it works as well, so now I have two solutions which is kind of a luxury position. Regards, Natxo On Thursday, June 3, 2021 at 7:41:21 AM UTC+2 Amnon wrote

[go-nuts] Re: parse output of exec.Command

2025-03-27 Thread natxo....@gmail.com
hi Jason, Thanks! Very nice code. In my use case the output is coming from openvpn cli (more precisely, openvpn --show-pkcs11-ids /path/to/opensc-pkcs11.so to get the a list of certificates on a smartcard, so not looking at the certificates themselves. I need to configure the config file for a

[go-nuts] parse output of exec.Command

2025-03-27 Thread natxo....@gmail.com
hi, I am trying to parse he output of a command and not getting the desired results. This is the sanitized output: Certificate DN: O=SUB,DOMAIN.TLD, CN=usernamej Serial: 33 Serialized id: pkcs11:model=PKCS%2315%20emulated;token=1;manufacturer=piv_

[go-nuts] Re: parse output of exec.Command

2025-03-27 Thread natxo....@gmail.com
obviously as soon as I post the question I think of the answer myself. I need to use pointers. Sorry for the noise, it's working now. On Thursday, March 27, 2025 at 3:31:29 PM UTC+1 natxo@gmail.com wrote: > hi, > > I am trying to parse he output of a command and not getti

[go-nuts] atal error: all goroutines are asleep - deadlock!

2025-05-22 Thread natxo....@gmail.com
hi, I do not seem to to get this one to not panic, and do not understand why yet. This code gets the names of files using shell globbing , so go run testchannels.go dir/* This gets the name and size info of all 1000 files in the dire, but panics at the end with a deadlock: fatal error: all