[go-nuts] Debugging memory leak when a GO process crashed

2023-01-09 Thread mariappan balraj
Hello Go experts, I could able to find the solution to debug memory leaks of GO process, when it is running by using PPROF. Is it possible to collect the heap profile for debugging, when GO process crashed using core dump? or what is the recommended way to root cause the memory leak? Based on the

Re: [go-nuts] go build error in darwin: duplicate symbol

2023-01-09 Thread Xie Zhenye
Maybe cgo should build a single .o file for the same .c file. On Tuesday, January 10, 2023 at 11:21:00 AM UTC+8 Xie Zhenye wrote: > It's caused by github.com/lufia/iostat. > > Maybe two different dependencies used 'iostat'. 'iostat; used cgo, and > produced an object file from .c file for each de

Re: [go-nuts] go build error in darwin: duplicate symbol

2023-01-09 Thread Xie Zhenye
It's caused by github.com/lufia/iostat. Maybe two different dependencies used 'iostat'. 'iostat; used cgo, and produced an object file from .c file for each dependency. Linker try to link both .o file that cause the problem. On Tuesday, March 23, 2021 at 12:25:17 AM UTC+8 Ian Lance Taylor wrote

[go-nuts] Re: Help Bootstrapping to ESXi

2023-01-09 Thread Mike Schinkel
Is your ESXi server not running an Intel x86 processor? That is what the article is about. Also, what OS is your guest VM running? -Mike On Monday, January 9, 2023 at 4:20:15 PM UTC-5 brett@gmail.com wrote: > Good afternoon, hoping to get a little help. > > I am trying to build a bootst

[go-nuts] Help Bootstrapping to ESXi

2023-01-09 Thread Brett Bergner
Good afternoon, hoping to get a little help. I am trying to build a bootstrap candidate that allows me to build and run go programs on an ESXi server. I am following this blog, and the issue is that my bootstrap c

[go-nuts] Re: [Proposal] Error slot

2023-01-09 Thread Oliver Smith
"or main could be lazy and let `error<-` panic when err != nil:" * would require that `action`'s signature be `func action() (string, error<-)` On Monday, January 9, 2023 at 12:10:25 PM UTC-8 Oliver Smith wrote: > A complete example (followed by the code it replaced): > > ``` > package main > >

[go-nuts] Re: [Proposal] Error slot

2023-01-09 Thread Oliver Smith
A complete example (followed by the code it replaced): ``` package main import ( "fmt" "os" ) func getMotd() (string, error<-) { motd, error<- := os.ReadFile("/etc/motd") return "MOTD:\n---\n" + string(motd) + "\n---\n", nil } func getPwd() (string, error<-) { pwd, error<- :

[go-nuts] Re: Naive Bayesian Classifier for Golang

2023-01-09 Thread Johan Liebert
Naive Bayes classifiers are *a collection of classification algorithms based on Bayes' Theorem*. It is not a single algorithm but a family of algorithms where all of them share a common principle, i.e. every pair of features being classified is independent of each other. Regards: Rarest philode

[go-nuts] Alternative text/template function libraries to github.com/Masterminds/sprig?

2023-01-09 Thread Tom Payne
github.com/Masterminds/sprig is a popular library of template functions, used by some popular projects, e.g. Kubernetes Helm. Unfortunately, Masterminds/sprig also has a number of inherent flaws: 1. The order of arguments to many of its functions is incompatible with text/template's pipeline synta

Re: [go-nuts] Generic array and slice type options

2023-01-09 Thread Daniel Theophanes
Thank you Ian. On Sun, Jan 8, 2023 at 10:40 PM Ian Lance Taylor wrote: > On Sun, Jan 8, 2023 at 1:17 PM Daniel Theophanes > wrote: > > > > When playing around with generics, I ran into what I perceive as an odd > limitation. > > > > I forked an audio package "beep" to do some fun generics with

Re: [go-nuts] CGO core dump analysis using GDB

2023-01-09 Thread Tamás Gulácsi
I'd create a separate C program, that can be communicated with RPC style - (https://github.com/protobuf-c/protobuf-c-rpc may solve it easily), and have the Go program start it like https://github.com/hashicorp/go-plugin . That way the stack traces and core dumps are separate, each program is ea

Re: [go-nuts] CGO core dump analysis using GDB

2023-01-09 Thread mariappan balraj
Hi Ian, Thanks. I will try this. When a process is crashed because of a SEGMENTATION fault, it can be debugged by identifying the stack trace from the core dump. Is there any other technique to debug this issue? Can you please help if any other technique is there? Best Regards Mariappan On Mon,