[go-nuts] Proposal: try function constructor

2019-06-28 Thread Li
I propose a addition to current try proposal to enable optional error wrapping. demo codes: package main import ( "fmt" "io" "os" ) // wrapErr is an error wrapping function func wrapErr(err error, format string, args ...interface{}) error { return fmt.Errorf( "%s: %s", fmt.Sprintf(format, args

[go-nuts] Re: Proposal: try function constructor

2019-06-29 Thread Li
Here's another demo that annotate errors with custom type. package main import ( "fmt" "io" "os" ) type Err struct { Codestring Message string Cause error } var _ error = Err{} func (e Err) Error() string { return fmt.Sprintf("[%s] %s: %s", e.Code, e.Message, e.Cause.Error()) } // wrapE

Re: [go-nuts] Better generator support

2020-10-27 Thread Li
You can use a closure as a generator: package main import "fmt" func getPositiveOdds( numbers []int, ) ( iter func() (int, bool), ) { iter = func() (ret int, ok bool) { for len(numbers) > 0 { if numbers[0] > 0 && numbers[0]&1 == 1 { ret = numbers[

[go-nuts] 1: json: cannot unmarshal array into Go value of type main.Catcher or 2: json: cannot unmarshal object into Go value of type main.Crypto4

2018-05-01 Thread m_@li
Hi ! I was searching relevant posts regarding error "json: cannot unmarshal array into Go value of type main.Catcher" or "json: cannot unmarshal object into Go value of type main.Crypto4". These two error messages are linked to the same program (depends on when I change structure). Actually I

[go-nuts] Does Golang need the innovation of C++ move semantics too

2018-05-25 Thread Li Jianhua
1. Why does C++ introduce move semantics anyway? What problems is it going to solve? 2. How come Golang, C (Without ++) don’t have that move semantics yet? Will they need the move soon? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group.

Re: [go-nuts] Does Golang need the innovation of C++ move semantics too

2018-05-26 Thread Li Jianhua
From: Ian Lance Taylor Sent: Saturday, May 26, 2018 2:56 PM Subject: Re: [go-nuts] Does Golang need the innovation of C++ move semantics too To: Li Jianhua Cc: On Fri, May 25, 2018 at 8:15 PM, Li Jianhua wrote: > > Why does C++ introduce move semantics anyway? What problems is it go

Re: [go-nuts] Does module name has to start with a valid domain name?

2019-08-05 Thread SZ Li
I see. Makes sense. Thanks, Shizheng On Mon, Aug 5, 2019 at 7:04 PM Ian Lance Taylor wrote: > On Mon, Aug 5, 2019 at 12:33 PM wrote: > > > > We are using bazel to manage dependency and would like to migrate to > modules and use JFrog's module proxy. We have many private modules, starts > with

[go-nuts] SWIG and anonymous field inheritance

2016-10-02 Thread Shengqiu Li
Hi all, I'm making a binding of a C++ library for go, and I'm wondering why the anonymous field inheritance isn't used in the go wrapper code. I have found a piece of comment in the go backend of SWIG, saying: // For each method defined in a base class but not defined in > // this c

Re: [go-nuts] SWIG and anonymous field inheritance

2016-10-04 Thread Shengqiu Li
`B::test`. It will be the same as call `b.Test` in Go. 在 2016年10月4日星期二 UTC+8上午3:01:24,Ian Lance Taylor写道: > > On Sun, Oct 2, 2016 at 2:03 AM, Shengqiu Li > wrote: > > > > I'm making a binding of a C++ library for go, and I'm wondering why the > > anonymous f

Re: [go-nuts] SWIG and anonymous field inheritance

2016-10-04 Thread Shengqiu Li
s say that A.m2 will call test_A_m2, the polymorphism on C++ side is still available. If we passed a pointer of an A object to test_A_m2, it will call A::m2; if we passed a pointer of B object to test_A_m2, it will call B::m2. 在 2016年10月4日星期二 UTC+8下午9:47:11,Ian Lance Taylor写道: > > On Tue, Oct

Re: [go-nuts] SWIG and anonymous field inheritance

2016-10-04 Thread Shengqiu Li
test(b) } It will print A::m1 B::m2 在 2016年10月4日星期二 UTC+8下午9:47:11,Ian Lance Taylor写道: > > On Tue, Oct 4, 2016 at 6:33 AM, Shengqiu Li > wrote: > > Thanks for your reply. In my view, the difference seems not affect the > > behavior. As we store the pointer of t

Re: [go-nuts] SWIG and anonymous field inheritance

2016-10-04 Thread Shengqiu Li
月4日星期二 UTC+8下午10:22:34,Ian Lance Taylor写道: > > On Tue, Oct 4, 2016 at 7:07 AM, Shengqiu Li > wrote: > > I have made a preliminary demo using the anonymous field feature > > github.com/dontpanic92/swig > > This is written in a way that I find hard to understand--I can&#x

Re: [go-nuts] SWIG and anonymous field inheritance

2016-10-04 Thread Shengqiu Li
done only once -- in the `NewC()` } Then when we call B's function, they will pass the SwigcptrB to the C++ functions -- which is correct. 在 2016年10月4日星期二 UTC+8下午10:22:34,Ian Lance Taylor写道: > > On Tue, Oct 4, 2016 at 7:07 AM, Shengqiu Li > wrote: > > I have made a prelim

Re: [go-nuts] infinite loop makes program stuck

2016-10-12 Thread Minglangjun Li
On Wed, Oct 12, 2016 at 11:53 AM, Jesse McNelis wrote: > If you have multiple CPUs (and the Go memory model assumes that you > always can) they won't even write updated values from their cache out > to main memory until they hit a lock. > The reading CPU has read a value from main memory and put

[go-nuts] Linux File descriptor question in golang

2016-07-21 Thread Homer Li
Could I get file path from the file descriptor number ? OS : Linux How to write in golang ? Thanks. -- Best Regards Homer Li -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emai

[go-nuts] Why dont the Marshal & Unmarshal use same amount of arguments and return values

2017-02-23 Thread Jianhua Li
func Marshal(v interface{}) ([]byte, error) func Unmarshal(data []byte, v interface{}) error Why dont the Marshal & Unmarshal use same amount of arguments, and same amount of return values like one of these. //1. func Marshal(data[]byte, v interface{}) (error) func Unmarshal(data []byte, v inter

[go-nuts] Re: Why dont the Marshal & Unmarshal use same amount of arguments and return values

2017-02-23 Thread Jianhua Li
i meant the json library > On 23 Feb 2017, at 20:42, Jianhua Li wrote: > > func Marshal(v interface{}) ([]byte, error) > func Unmarshal(data []byte, v interface{}) error > > Why dont the Marshal & Unmarshal use same amount of arguments, and same > amount of return

[go-nuts] About the confusion caused by type conversion in golang

2021-01-27 Thread Barry Li
Some doubts about type conversion in go. In the following code, why can it be executed normally after passing the variable? The code is an error during the compilation phase. // The following two lines of code can be executed normally x := uint64(256) fmt.Println(byte(uint64(x))) // norma

[go-nuts] DataRace with slice, should i fix it or ignore it?

2022-02-09 Thread Pelen Li
I want to set a value with the index of the slice. I don't really care if there are multiple goroutines cover the value with each other, because the value is same. Can i just ignore this DataRace Warning? I don't know if this will cause panic. *Here's my example:* I defined a structure with sl

[go-nuts] Why traversing Go hashmap so slower then C++ hashmap

2022-06-28 Thread Yan Li
*System env:* $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description:Ubuntu 18.04.6 LTS Release:18.04 Codename: bionic $ go version go version go1.18.3 linux/amd64 $ g++ -v gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) *Test traversing Go hashmap:*

[go-nuts] How to collect information in each package’s source code directory when building a project

2023-03-15 Thread Qingwei Li
I'm trying to collect information dumped in each package's source code directory when building a project. I have tried to ask in How to collect information in each package's source code directory when building a project - Getting Help - Go Forum (golangbridge.org)

Re: [go-nuts] Re: 'go run hello.go' taking ~30 seconds on windows

2023-06-22 Thread Jet Li
Like to note that if you mean Windows Defender, there is no way to disable that after Build 20H2 iirc where I was task to deploy Windows 10 and could not find the option in Windows Group Policy settings after the update, if Go app are affected by Windows Defender. Your only option is to use olde

[go-nuts] Re: Maybe a Bug? The Go compiler stores a stack pointer into a global object

2023-08-02 Thread Qingwei Li
I notice that Go1.17.7 still allocates the array on heap by calling newobject while Go1.18 allocates the array on stack. I also notice that in the release note of Go1.18 that "The garbage collector now includes non-heap sources of garbage collector work". Does the GC in 1.18 and following versi

[go-nuts] Re: golang splitting string by space but considering quoted section as a single part

2023-09-21 Thread Albert Li
// SplitString split string with a rune comma ignore quoted func SplitString(str string, r rune) []string { quoted := false return strings.FieldsFunc(str, func(r1 rune) bool { if r1 == '\'' { quoted = !quoted } return !quoted && r1 == r }) } // TestSpitString test case func TestSpitString(t *testin

[go-nuts] Suggestions to hide plaintext password in net/smtp

2016-10-26 Thread vincent . mc . li
Hi I am new to Go and I have a go program to send email similar to https://golang.org/pkg/net/smtp/#example_SendMail below: func main() { // Set up authentication information. auth := smtp.PlainAuth("", "u...@example.com", "password", "example.com") // </blockquote><br> <h3><span class=subject><a href="/golang-nuts@googlegroups.com/msg10012.html">[go-nuts] Subject_Alt_name in x509.Certificate</a></span></h3> <div class="darkgray font13"> <span class="sender pipe"> <span class=date><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=date:20170228&amp;o=newest">2017-02-28</a></span></span> <span class="sender pipe"> <span class=thead><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=subject:%22%5C%5Bgo%5C-nuts%5C%5D+Subject_Alt_name+in+x509.Certificate%22&amp;o=newest">Thread</a></span></span> <span class=name><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=from:%22%27Tao+Li%27+via+golang%5C-nuts%22&amp;o=newest">&#x27<B>;T</B>ao Li&#x27; via golang-nuts</a></span> </div> <blockquote><span class="msgFragment"> Currently it only supports DNSNames, EmailAddresses, and IPAddresses, is there any plan to support URI as well? Thanks Tao -- 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</span> </blockquote><br> <h3><span class=subject><a href="/golang-nuts@googlegroups.com/msg46796.html">[go-nuts] How go.work knows which module refers to which folder</a></span></h3> <div class="darkgray font13"> <span class="sender pipe"> <span class=date><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=date:20220406&amp;o=newest">2022-04-06</a></span></span> <span class="sender pipe"> <span class=thead><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=subject:%22%5C%5Bgo%5C-nuts%5C%5D+How+go.work+knows+which+module+refers+to+which+folder%22&amp;o=newest">Thread</a></span></span> <span class=name><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=from:%22%27Jack+Li%27+via+golang%5C-nuts%22&amp;o=newest">&#x27;<B>Ja</B>ck Li&#x27; via golang-nuts</a></span> </div> <blockquote><span class="msgFragment"> Hi group, In the go.mod replace way, there’s a one-to-one mapping relationship, for example, the module example.com/hello is mapped to folder …/hello ``` $ go mod edit -replace example.com/hello=../hello $ view go.mod replace example.com/hello => ../hello  $ ``` Now with the go.work way. If </span> </blockquote><br> <h3><span class=subject><a href="/golang-nuts@googlegroups.com/msg46798.html">[go-nuts] Handle 1 million concurrent connections with 50 lines Go code</a></span></h3> <div class="darkgray font13"> <span class="sender pipe"> <span class=date><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=date:20220406&amp;o=newest">2022-04-06</a></span></span> <span class="sender pipe"> <span class=thead><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=subject:%22%5C%5Bgo%5C-nuts%5C%5D+Handle+1+million+concurrent+connections+with+50+lines+Go+code%22&amp;o=newest">Thread</a></span></span> <span class=name><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=from:%22%27Jack+Li%27+via+golang%5C-nuts%22&amp;o=newest">&#x27;<B>Ja</B>ck Li&#x27; via golang-nuts</a></span> </div> <blockquote><span class="msgFragment"> Hi group, I am going through this page: https://studygolang.com/articles/22820 , It claims that the 50 lines of Go code handles 1 million concurrent connections from network clients, on 1 single server machine with a 4-Core CPU and 16G memory. Does the package net already utilize IO Multiple</span> </blockquote><br> <h3><span class=subject><a href="/golang-nuts@googlegroups.com/msg46803.html">Re:[go-nuts] Re: How go.work knows which module refers to which folder</a></span></h3> <div class="darkgray font13"> <span class="sender pipe"> <span class=date><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=date:20220406&amp;o=newest">2022-04-06</a></span></span> <span class="sender pipe"> <span class=thead><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=subject:%22Re%5C%3A%5C%5Bgo%5C-nuts%5C%5D+Re%5C%3A+How+go.work+knows+which+module+refers+to+which+folder%22&amp;o=newest">Thread</a></span></span> <span class=name><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=from:%22%27Jack+Li%27+via+golang%5C-nuts%22&amp;o=newest">&#x27;<B>Ja</B>ck Li&#x27; via golang-nuts</a></span> </div> <blockquote><span class="msgFragment">e&#x27; directive does not add modules contained in subdirectories of its argument directory. Those modules may be added by the directory containing their go.mod file in separate &#x27;use&#x27; directives. Hope that helps, and sorry if that does not address your question. Regards, thepudds On Wedn</span> </blockquote><br> <h3><span class=subject><a href="/golang-nuts@googlegroups.com/msg46823.html">[go-nuts] MaxDiskSize MaxLogCount for glog?</a></span></h3> <div class="darkgray font13"> <span class="sender pipe"> <span class=date><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=date:20220407&amp;o=newest">2022-04-07</a></span></span> <span class="sender pipe"> <span class=thead><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=subject:%22%5C%5Bgo%5C-nuts%5C%5D+MaxDiskSize+MaxLogCount+for+glog%5C%3F%22&amp;o=newest">Thread</a></span></span> <span class=name><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=from:%22%27Jack+Li%27+via+golang%5C-nuts%22&amp;o=newest">&#x27;<B>Ja</B>ck Li&#x27; via golang-nuts</a></span> </div> <blockquote><span class="msgFragment"> Hi group, I only find MaxSize in glog which sets the size of each log file.  Can glog support the options like how many disk size (ie. 10%, 1.8G, etc.) all the log files may use in total, and the count (ie. 10) of log files it can save. For example, logfile1.txt, logfile2.txt, ..., logfile10.</span> </blockquote><br> <h3><span class=subject><a href="/golang-nuts@googlegroups.com/msg46829.html">Re: [go-nuts] Missing /usr/lib/go/pkg/include/ for native binaries</a></span></h3> <div class="darkgray font13"> <span class="sender pipe"> <span class=date><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=date:20220407&amp;o=newest">2022-04-07</a></span></span> <span class="sender pipe"> <span class=thead><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=subject:%22%5C%5Bgo%5C-nuts%5C%5D+Missing+%5C%2Fusr%5C%2Flib%5C%2Fgo%5C%2Fpkg%5C%2Finclude%5C%2F+for+native+binaries%22&amp;o=newest">Thread</a></span></span> <span class=name><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=from:%22%27Jack+Li%27+via+golang%5C-nuts%22&amp;o=newest">&#x27;<B>Ja</B>ck Li&#x27; via golang-nuts</a></span> </div> <blockquote><span class="msgFragment"> Yes, I download the latest go 1.18 installer for macOS from golang.google.cn. There's no problem with the installer from the official site. -- Original -- From: "Ian Lance Taylor"http://deb.debian.org/debian bullseye-backports/main amd64 Packages >  *** 1.17.6-1</span> </blockquote><br> <h3><span class=subject><a href="/golang-nuts@googlegroups.com/msg46834.html">Re:[go-nuts] Re: MaxDiskSize MaxLogCount for glog?</a></span></h3> <div class="darkgray font13"> <span class="sender pipe"> <span class=date><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=date:20220409&amp;o=newest">2022-04-09</a></span></span> <span class="sender pipe"> <span class=thead><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=subject:%22Re%5C%3A%5C%5Bgo%5C-nuts%5C%5D+Re%5C%3A+MaxDiskSize+MaxLogCount+for+glog%5C%3F%22&amp;o=newest">Thread</a></span></span> <span class=name><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=from:%22%27Jack+Li%27+via+golang%5C-nuts%22&amp;o=newest">&#x27;<B>Ja</B>ck Li&#x27; via golang-nuts</a></span> </div> <blockquote><span class="msgFragment"> Is it still maintained? The last commit is Aug 20, 2021 which is more than half year ago. The last commit of glog in C++ is just 5 days ago. -- Original -- From: "peterGo"https://github.com/golang/glog#glog   "The code in this repo is for export only and i</span> </blockquote><br> <h3><span class=subject><a href="/golang-nuts@googlegroups.com/msg46835.html">[go-nuts] float exactness</a></span></h3> <div class="darkgray font13"> <span class="sender pipe"> <span class=date><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=date:20220409&amp;o=newest">2022-04-09</a></span></span> <span class="sender pipe"> <span class=thead><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=subject:%22%5C%5Bgo%5C-nuts%5C%5D+float+exactness%22&amp;o=newest">Thread</a></span></span> <span class=name><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=from:%22%27Jack+Li%27+via+golang%5C-nuts%22&amp;o=newest">&#x27;<B>Ja</B>ck Li&#x27; via golang-nuts</a></span> </div> <blockquote><span class="msgFragment"> Hi group, 1.  Is there a package can do exact float operations, like Decimal in Python? For example: x := 0.1; y := 0.2; z := x + y; z will be exact 0.3 2. Why literal operation is exact, variable is not? fmt.Println(0.1 + 0.2) // 0.3 exactly fmt.Println(x + y) // 0.30004 </span> </blockquote><br> <h3><span class=subject><a href="/golang-nuts@googlegroups.com/msg46839.html">Re: [go-nuts] float exactness</a></span></h3> <div class="darkgray font13"> <span class="sender pipe"> <span class=date><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=date:20220409&amp;o=newest">2022-04-09</a></span></span> <span class="sender pipe"> <span class=thead><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=subject:%22%5C%5Bgo%5C-nuts%5C%5D+float+exactness%22&amp;o=newest">Thread</a></span></span> <span class=name><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=from:%22%27Jack+Li%27+via+golang%5C-nuts%22&amp;o=newest">&#x27;<B>Ja</B>ck Li&#x27; via golang-nuts</a></span> </div> <blockquote><span class="msgFragment"> Thanks Robert, It is great! a, _ := decimal.NewFromString("0.1") b, _ := decimal.NewFromString("0.2") c := a.Add(b) fmt.Println("decimal:", c) a = decimal.NewFromFloat(0.1) b = decimal.NewFromFloat(0.2) c = a.Add(b) fmt.Println("</span> </blockquote><br> <h3><span class=subject><a href="/golang-nuts@googlegroups.com/msg46892.html">[go-nuts] Why Go has only slice and map</a></span></h3> <div class="darkgray font13"> <span class="sender pipe"> <span class=date><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=date:20220411&amp;o=newest">2022-04-11</a></span></span> <span class="sender pipe"> <span class=thead><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=subject:%22%5C%5Bgo%5C-nuts%5C%5D+Why+Go+has+only+slice+and+map%22&amp;o=newest">Thread</a></span></span> <span class=name><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=from:%22%27Jack+Li%27+via+golang%5C-nuts%22&amp;o=newest">&#x27;<B>Ja</B>ck Li&#x27; via golang-nuts</a></span> </div> <blockquote><span class="msgFragment"> Hi group, Why Go provides only 2 built-in data structures, slice and map. It has just more than C, but less than all other programming languages I've heard of, C++, Python, Swift, Rust.  I think this simplicity attracts me very much. Sometimes I can use only one data structures for a task. B</span> </blockquote><br> <h3><span class=subject><a href="/golang-nuts@googlegroups.com/msg48689.html">[go-nuts] GoLLVM: using the result of `go build -x . ` to rebuild the program got failed</a></span></h3> <div class="darkgray font13"> <span class="sender pipe"> <span class=date><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=date:20221027&amp;o=newest">2022-10-27</a></span></span> <span class="sender pipe"> <span class=thead><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=subject:%22%5C%5Bgo%5C-nuts%5C%5D+GoLLVM%5C%3A+using+the+result+of+%60go+build+%5C-x+.+%60+to+rebuild+the+program+got+failed%22&amp;o=newest">Thread</a></span></span> <span class=name><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=from:%22%27Qingwei+Li%27+via+golang%5C-nuts%22&amp;o=newest">&#x27;Qin<B>gw</B>ei Li&#x27; via golang-nuts</a></span> </div> <blockquote><span class="msgFragment"> the GoLLVM is based on LLVM 15.0.0 Example to reproduce: The structure of project is as follows: ``` easyPkg/ ├── go.mod ├── main.go └── Pkg └── utils.go ``` main.go ``` package main import "easyPkg/Pkg" func main() { Pkg.PkgFunc() } ``` utils.go ``` package Pkg func PkgFunc() { </span> </blockquote><br> <h3><span class=subject><a href="/golang-nuts@googlegroups.com/msg48702.html">Re: [go-nuts] GoLLVM: using the result of `go build -x . ` to rebuild the program got failed</a></span></h3> <div class="darkgray font13"> <span class="sender pipe"> <span class=date><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=date:20221027&amp;o=newest">2022-10-27</a></span></span> <span class="sender pipe"> <span class=thead><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=subject:%22%5C%5Bgo%5C-nuts%5C%5D+GoLLVM%5C%3A+using+the+result+of+%60go+build+%5C-x+.+%60+to+rebuild+the+program+got+failed%22&amp;o=newest">Thread</a></span></span> <span class=name><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=from:%22%27Qingwei+Li%27+via+golang%5C-nuts%22&amp;o=newest">&#x27;Qin<B>gw</B>ei Li&#x27; via golang-nuts</a></span> </div> <blockquote><span class="msgFragment">ion &#x27;-fgo-importcfg=/dev/null&#x27; &gt; &gt; The Go command only passes this option to the compiler if it thinks that &gt; the compiler is the main go compiler (&quot;gc&quot;) as opposed to gollvm. What &gt; output do you get when you run &quot;go version&quot; ? &gt; &gt; Thanks, Tha</span> </blockquote><br> <h3><span class=subject><a href="/golang-nuts@googlegroups.com/msg48703.html">Re: [go-nuts] GoLLVM: using the result of `go build -x . ` to rebuild the program got failed</a></span></h3> <div class="darkgray font13"> <span class="sender pipe"> <span class=date><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=date:20221027&amp;o=newest">2022-10-27</a></span></span> <span class="sender pipe"> <span class=thead><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=subject:%22%5C%5Bgo%5C-nuts%5C%5D+GoLLVM%5C%3A+using+the+result+of+%60go+build+%5C-x+.+%60+to+rebuild+the+program+got+failed%22&amp;o=newest">Thread</a></span></span> <span class=name><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=from:%22%27Qingwei+Li%27+via+golang%5C-nuts%22&amp;o=newest">&#x27;Qin<B>gw</B>ei Li&#x27; via golang-nuts</a></span> </div> <blockquote><span class="msgFragment">r supports that option. The &gt; errors about -fgo-importcfg and -ffile-prefix-map can be ignored. &gt; &gt; Not sure what is happening elsewhere, though. You showed the output &gt; but not the commands. &gt; &gt; Ian &gt; &gt; &gt; &gt; &gt; On Thu, Oct 27, 2022 at 12:05 PM &#x27;Qing</span> </blockquote><br> <h3><span class=subject><a href="/golang-nuts@googlegroups.com/msg48709.html">Re: [go-nuts] GoLLVM: using the result of `go build -x . ` to rebuild the program got failed</a></span></h3> <div class="darkgray font13"> <span class="sender pipe"> <span class=date><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=date:20221028&amp;o=newest">2022-10-28</a></span></span> <span class="sender pipe"> <span class=thead><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=subject:%22%5C%5Bgo%5C-nuts%5C%5D+GoLLVM%5C%3A+using+the+result+of+%60go+build+%5C-x+.+%60+to+rebuild+the+program+got+failed%22&amp;o=newest">Thread</a></span></span> <span class=name><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=from:%22%27Qingwei+Li%27+via+golang%5C-nuts%22&amp;o=newest">&#x27;Qin<B>gw</B>ei Li&#x27; via golang-nuts</a></span> </div> <blockquote><span class="msgFragment">962446f5337585f526e576b335a45 /data/mygo/gollvm_workarea/install/tools/buildid -w $WORK/b001/exe/a.out # internal cp $WORK/b001/exe/a.out easyPkg rm -r $WORK/b001/ ``` 在2022年10月28日星期五 UTC+8 14:17:46 写道: &gt; Thanks. What I meant was that you showed us the errors from the generated &gt; sh</span> </blockquote><br> <h3><span class=subject><a href="/golang-nuts@googlegroups.com/msg48761.html">Re: [go-nuts] GoLLVM: using the result of `go build -x . ` to rebuild the program got failed</a></span></h3> <div class="darkgray font13"> <span class="sender pipe"> <span class=date><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=date:20221031&amp;o=newest">2022-10-31</a></span></span> <span class="sender pipe"> <span class=thead><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=subject:%22%5C%5Bgo%5C-nuts%5C%5D+GoLLVM%5C%3A+using+the+result+of+%60go+build+%5C-x+.+%60+to+rebuild+the+program+got+failed%22&amp;o=newest">Thread</a></span></span> <span class=name><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=from:%22%27Qingwei+Li%27+via+golang%5C-nuts%22&amp;o=newest">&#x27;Qin<B>gw</B>ei Li&#x27; via golang-nuts</a></span> </div> <blockquote><span class="msgFragment">&#x27; ``` I succeeded to generate a whole program llvm IR last weekend, but I forgot what I did to get it. The key point might not be the soft link. What can I do? 在2022年10月28日星期五 UTC+8 14:17:46 写道: &gt; Thanks. What I meant was that you showed us the errors from the generated &gt;</span> </blockquote><br> <h3><span class=subject><a href="/golang-nuts@googlegroups.com/msg48762.html">Re: [go-nuts] GoLLVM: using the result of `go build -x . ` to rebuild the program got failed</a></span></h3> <div class="darkgray font13"> <span class="sender pipe"> <span class=date><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=date:20221101&amp;o=newest">2022-11-01</a></span></span> <span class="sender pipe"> <span class=thead><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=subject:%22%5C%5Bgo%5C-nuts%5C%5D+GoLLVM%5C%3A+using+the+result+of+%60go+build+%5C-x+.+%60+to+rebuild+the+program+got+failed%22&amp;o=newest">Thread</a></span></span> <span class=name><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=from:%22%27Qingwei+Li%27+via+golang%5C-nuts%22&amp;o=newest">&#x27;Qin<B>gw</B>ei Li&#x27; via golang-nuts</a></span> </div> <blockquote><span class="msgFragment">c `-c` option to compile &gt; `utils.go, main.go` to object files with option `-emit-llvm` added for &gt; llvm-link&#x27;s final linking of all object files. &gt; &gt; After I get `$WORK/b001/_go_.o`, I use llvm-link to link all _go_.o to get &gt; a whole program llvm IR. But errors occur when</span> </blockquote><br> <h3><span class=subject><a href="/golang-nuts@googlegroups.com/msg48763.html">Re: [go-nuts] GoLLVM: using the result of `go build -x . ` to rebuild the program got failed</a></span></h3> <div class="darkgray font13"> <span class="sender pipe"> <span class=date><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=date:20221101&amp;o=newest">2022-11-01</a></span></span> <span class="sender pipe"> <span class=thead><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=subject:%22%5C%5Bgo%5C-nuts%5C%5D+GoLLVM%5C%3A+using+the+result+of+%60go+build+%5C-x+.+%60+to+rebuild+the+program+got+failed%22&amp;o=newest">Thread</a></span></span> <span class=name><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=from:%22%27Qingwei+Li%27+via+golang%5C-nuts%22&amp;o=newest">&#x27;Qin<B>gw</B>ei Li&#x27; via golang-nuts</a></span> </div> <blockquote><span class="msgFragment">; rm -r $WORK/b001/ &gt; ``` &gt; &gt; The modified part of script is using llvm-goc `-c` option to compile &gt; `utils.go, main.go` to object files with option `-emit-llvm` added for &gt; llvm-link&#x27;s final linking of all object files. &gt; &gt; After I get `$WORK/b001/_go_.o`, I us</span> </blockquote><br> <h2></h2> </div> <div class="aside" role="complementary"> <div class="logo"> <a href="/"><img src="/logo.png" width=247 height=88 alt="The Mail Archive"></a> </div> <h2>42 matches</h2> <br> <ul><li><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=from%3A%22Li%22&amp;a=1">Advanced search</a></li></ul> <form class="overflow" action="/search" method="get"> <input type="hidden" name="l" value="golang-nuts@googlegroups.com"> <label class="hidden" for="q">Search the list</label> <input class="submittext" type="text" id="q" name="q" placeholder="Search golang-nuts" value="from:&quot;Li&quot;"> <input class="submitbutton" id="submit" type="image" src="/submit.png" alt="Submit"> </form> <div class="nav margintop" id="nav" role="navigation"> <h2 class="hidden"> Site Navigation </h2> <ul class="icons font16"> <li class="icons-home"><a href="/">The Mail Archive home</a></li> <li class="icons-list"> <a href="/golang-nuts@googlegroups.com" title="c" id="c">golang-nuts - all messages</a></li> <li class="icons-about"> <a href="/golang-nuts@googlegroups.com/info.html">golang-nuts - about the list</a></li> <li class="icons-expand"><a href="/search?l=golang-nuts%40googlegroups.com&amp;q=from%3A%22Li%22&amp;f=1" title="e" id="e">Expand</a></li> </ul> </div> <div class="listlogo margintopdouble"> <h2 class="hidden"> Mail list logo </h2> </div> </div> <div class="footer" role="contentinfo"> <h2 class="hidden"> Footer information </h2> <ul> <li><a href="/">The Mail Archive home</a></li> <li><a href="/faq.html#newlist">Add your mailing list</a></li> <li><a href="/faq.html">FAQ</a></li> <li><a href="/faq.html#support">Support</a></li> <li><a href="/faq.html#privacy">Privacy</a></li> </ul> </div> <script language="javascript" type="text/javascript"> document.onkeydown = NavigateThrough; function NavigateThrough (event) { if (!document.getElementById) return; if (window.event) event = window.event; if (event.target.tagName == 'INPUT') return; if (event.ctrlKey || event.metaKey) return; var link = null; switch (event.keyCode ? event.keyCode : event.which ? event.which : null) { case 69: link = document.getElementById ('e'); break; } if (link && link.href) document.location = link.href; } </script> </body> </html>