[go-nuts] Debug Go DLL

2022-09-29 Thread Gladiators Squad
Hi everyone, Is there any way to debug DLL files once it is loaded? -- 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

[go-nuts] Re: Creating and Accessing DLL methods in GO

2022-09-29 Thread Gladiators Squad
is go-plugin supported by Windows?...We want to create go dll and tey to access through go code On Thursday, September 29, 2022 at 5:12:34 PM UTC+5:30 Brian Candler wrote: > My first reaction is, do you *really* want to call a Go DLL from a Go main > program? It seems to me like you will have t

[go-nuts] Re: Writing Json output to a file

2022-09-29 Thread Simon Archer
import ( "encoding/json" "fmt" "io" ) func PrintPrettyJSON(data any, writer io.Writer) error { b, err := json.MarshalIndent(data, "", "") if err != nil { return err } content := string(b) _, err = fmt.Fprintf(writer, "%s\n", content) return err } On

Re: [go-nuts] should syscall.EINVAL be a fs.ErrInvalid?

2022-09-29 Thread Ian Lance Taylor
On Thu, Sep 29, 2022 at 11:44 AM Rafael Ávila de Espíndola wrote: > > Ian Lance Taylor writes: > > > On Thu, Sep 29, 2022 at 10:29 AM Rafael Ávila de Espíndola > > wrote: > >> > >> Currently errors.Is(syscall.ENOENT, fs.ErrNotExist) return true, but > >> errors.Is(syscall.EINVAL, fs.ErrInvalid)

[go-nuts] [security] Go 1.19.2 and Go 1.18.7 pre-announcement

2022-09-29 Thread announce
Hello gophers, We plan to issue Go 1.19.2 and Go 1.18.7 on Tuesday, October 4. These minor releases include PRIVATE security fixes to the standard library. Following our security policy, this is the pre-announcement of those releases. Thanks, The Go team -- You received this message because y

Re: [go-nuts] should syscall.EINVAL be a fs.ErrInvalid?

2022-09-29 Thread Rafael Ávila de Espíndola
Ian Lance Taylor writes: > On Thu, Sep 29, 2022 at 10:29 AM Rafael Ávila de Espíndola > wrote: >> >> Currently errors.Is(syscall.ENOENT, fs.ErrNotExist) return true, but >> errors.Is(syscall.EINVAL, fs.ErrInvalid) returns false. As far as I can >> tell that is because of >> >> func (e Errno) Is(

Re: [go-nuts] should syscall.EINVAL be a fs.ErrInvalid?

2022-09-29 Thread Ian Lance Taylor
On Thu, Sep 29, 2022 at 10:29 AM Rafael Ávila de Espíndola wrote: > > Currently errors.Is(syscall.ENOENT, fs.ErrNotExist) return true, but > errors.Is(syscall.EINVAL, fs.ErrInvalid) returns false. As far as I can > tell that is because of > > func (e Errno) Is(target error) bool { > switch

Re: [go-nuts] Writing Json output to a file

2022-09-29 Thread Eli Bendersky
On Thu, Sep 29, 2022 at 10:47 AM Mahesh Sharma wrote: > Hi, > I'm collecting some JSON from an end point. I can print this to screen: > fmt.Printf("%s\n", bodyText). > > I'm struggling to figure how to write the bodyText to a file. > > Any help appreciated. > See https://gobyexample.com/writ

[go-nuts] go program import ?

2022-09-29 Thread alex-coder
Hi All, How I could detect programmatically that import in a go code belongs to a go distribution ? thank you very much for the answer. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails fro

[go-nuts] Writing Json output to a file

2022-09-29 Thread Mahesh Sharma
Hi, I'm collecting some JSON from an end point. I can print this to screen: fmt.Printf("%s\n", bodyText). I'm struggling to figure how to write the bodyText to a file. Any help appreciated. -- You received this message because you are subscribed to the Google Groups "golang-nuts" grou

[go-nuts] How is the relationship between package version and tag, and what is the formation mechanism?

2022-09-29 Thread 'Jinchang Hu' via golang-nuts
When we use go list -m dependencyName@Version to get the specific information of the version of the dependency package, does the Version and the tag of the dependency in github.com correspond, which tags will be recognized by the go language, and allow us to pass the go list command Get specifi

[go-nuts] should syscall.EINVAL be a fs.ErrInvalid?

2022-09-29 Thread Rafael Ávila de Espíndola
Currently errors.Is(syscall.ENOENT, fs.ErrNotExist) return true, but errors.Is(syscall.EINVAL, fs.ErrInvalid) returns false. As far as I can tell that is because of func (e Errno) Is(target error) bool { switch target { case oserror.ErrPermission: return e == EACCES

[go-nuts] Re: Creating and Accessing DLL methods in GO

2022-09-29 Thread Brian Candler
My first reaction is, do you *really* want to call a Go DLL from a Go main program? It seems to me like you will have two active copies of the Go runtime with their own garbage collectors etc. Go "plugins" might be closer to what you need: https://medium.com/learning-the-go-programming-language/

[go-nuts] Re: Creating and Accessing DLL methods in GO

2022-09-29 Thread Peter Galbavy
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, you > hav

[go-nuts] Re: Creating and Accessing DLL methods in GO

2022-09-29 Thread Peter Galbavy
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

[go-nuts] Creating and Accessing DLL methods in GO

2022-09-29 Thread Gladiators Squad
Hi Everyone, I'm trying to create go DLL for the below program using "go build -buildmode=c-shared -o calc.so calc.go" *package mainimport "C"func main() {}//export SayHellofunc SayHello(name string) {fmt.Printf("Go says: Hello, %s!\n", name)}//export Addfunc Add(num0, num1 int) int