[go-nuts] Re: about GOPRIVATE, sumdb and proxy?

2025-01-06 Thread xie cui
I think I have found the reason. Because the GONOSUMDB is default to GOPRIVATE, but when GONOSUMDB has already a value, the GOPRIVATE will not set to GONOSUMDB automately. On Monday, January 6, 2025 at 11:27:30 PM UTC+8 xie cui wrote: > AFAIK, if we configure the GOPRIVATE, then the proxy

[go-nuts] about toolchain directive in go.mod?

2024-07-24 Thread xie cui
go.mod: module toolchain_test go 1.22.3 toolchain go1.25.0 main.go: package main func main() { println("Hello World!") } when run go build, I think that should try to download toolchain 1.25.0 which do not exist. So I expect that cmd should failed. But It run sucess. -- You received thi

[go-nuts] about 0-RTT in golang std tls 1.3 impl?

2024-07-23 Thread xie cui
does current go version support 0-RTT in clent and server with tls1.3。 I find it may be not. https://github.com/golang/go/blob/90bcc552c0347948166817a602f612f219bc980c/src/crypto/tls/handshake_server_tls13.go#L158 -- You received this message because you are subscribed to the Google Groups "gola

[go-nuts] From which programming language did the idea for Golang's interface mechanism design originate?

2023-08-24 Thread xie cui
I remembe someone in a video in youtube explain the design of interface. But I cann't find it now. -- 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+un

[go-nuts] why the go install package download from official website of go1.21 is less than go1.20?

2023-08-15 Thread xie cui
go1.20.7.darwin-arm64.tar.gz ArchivemacOSARM6492MB go1.21.0.darwin-arm64.tar.gz ArchivemacOSARM6462MB this size reduce about 30%. why the size reduce a lot? -- You received this message because you

[go-nuts] about upstream?

2022-11-02 Thread xie cui
there are two micro service writen in go, let's call them A and B. A will call B. In this scene we will call B is the upstream of A. or A is the upstream of B? which one is correct way? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubsc

[go-nuts] how to minimize the size of struct?

2022-07-13 Thread xie cui
https://github.com/orijtech/structslop/blob/13637e228c1a50d8444da1b71a83aff3b6536851/structslop.go#L246-L267 why sort by can minimize the sizeof struct? is there some formal prove? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

[go-nuts] minium git version required when using go mod?

2022-06-23 Thread xie cui
what is minium git version when using go mod? -- 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 view this discussion on

[go-nuts] what is tab itab short for?

2022-06-23 Thread xie cui
https://github.com/golang/go/blob/bfbb288574841f2db2499a580d7bf985a5df4556/src/runtime/runtime2.go#L203 what is tab/itab short for? -- 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,

[go-nuts] what is //go:build difference from //+build?

2022-06-15 Thread xie cui
about when these feature add to golang? and is all we can do with //go:build can do with //+build, and vice versa? -- 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

[go-nuts] about function argument type infer?

2022-03-20 Thread xie cui
package main import ( "fmt" "reflect" ) import "golang.org/x/exp/constraints" // Double returns a new slice that contains all the elements of s, doubled. func Double[E constraints.Integer](s []E) []E { r := make([]E, len(s)) for i, v := range s { r[i

[go-nuts] about keyword constraint?

2022-03-19 Thread xie cui
in the period of typeparam development, we have try to add a keyword constraint, why we remove it finally, i am trying to understand why to add it and why to remove int finally. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe fro

[go-nuts] about for range with array?

2021-12-24 Thread xie cui
in the lang spec , it says: *The range expression x is evaluated once before beginning the loop, with one exception: if at most one iteration variable is present and len(x) is constant, the range expression is not evaluated.* https://go.dev/play/p/frLAvStO

[go-nuts] Do you have a minimal runnable go code that contain all key words in go?

2021-12-05 Thread xie cui
show me you code -- 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 view this discussion on the web visit https://group

Re: [go-nuts] how atomic instruction work?

2021-09-21 Thread xie cui
"feature", the lock prefix results in a full memory barrier. In my opinion, full memory barrier means flush store buffer and invalid queue(not very sure, is this right?) On Saturday, September 18, 2021 at 3:17:26 AM UTC+8 Ian Lance Taylor wrote: > On Fri, Sep 17, 2021 at 6:25 AM x

[go-nuts] how atomic instruction work?

2021-09-17 Thread xie cui
how atomic insturction work in golang at x86/amd64, I think the atomic insturtion will flush the store buffer and invalid queue of current cpu core, but I am not sure, does someone know about it? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group.

[go-nuts] why semTabSize is 251?

2021-09-15 Thread xie cui
https://github.com/golang/go/blob/master/src/runtime/sema.go#L47 why this const is 251, not other like 256? -- 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 golan

[go-nuts] how map in golang solve hash collision?

2021-09-04 Thread xie cui
I am discussing with my friends about how map solve hash collision. In my opinion, map uses separate chaining to solve hash collision. but some of my friends think it is linear probing that solve the hash collision. -- You received this message because you are subscribed to the Google Groups "

[go-nuts] about golang defer?

2021-06-27 Thread xie cui
a defer call generate some code like: - - v42 (8) = StaticLECall {AuxCall{runtime.deferprocStack}} [8] v36 v41 - v43 (8) = SelectN [0] v42 - Defer v42 → b2 b3 (likely) (8) - b2: ← b1- - - v48 (7) = Copy v43 - v49 (7) = VarKill {.autotmp_0} v48

[go-nuts] how break point work in multi-thread multi-core linux?

2021-06-09 Thread xie cui
as for as i known, in linux, seting a breakpoint means we set int 3 instruction to the right place, it's easy to understand in single core os for me. but what happen when it's multi-core multi-thread enviroment like go program. using goland when set a breakpoint, when the breakpoint hit, it see

[go-nuts] times of stw in one gc cycle?

2021-06-06 Thread xie cui
https://github.com/golang/go/blob/master/src/runtime/mgc.go#L858-L876 due to these code lines, stw in one gc cycle may happen more than 2 times. so stw times in one gc cycle could be 2(general), 3, 4, and even for ever? -- You received this message because you are subscribed to the Google

[go-nuts] derefs in location when doing escape analysis?

2021-05-03 Thread xie cui
https://github.com/golang/go/blob/master/src/cmd/compile/internal/escape/escape.go#L136 this comment show me that the derefs field of type location is using the do something like min path between root to this location, but each call to walk one has different roots, some i don't understand why th

[go-nuts] Re: what is a &^= b means?

2021-04-24 Thread xie cui
it means OANDNOT!!! On Saturday, April 24, 2021 at 8:42:01 PM UTC+8 xie cui wrote: > func f(a, b int) int { > a &^= b > return a > } > what is this op (&^=) means? > -- You received this message because you are subscribed to the Google Groups "golang-n

[go-nuts] what is a &^= b means?

2021-04-24 Thread xie cui
func f(a, b int) int { a &^= b return a } what is this op (&^=) means? -- 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...@googlegroup

[go-nuts] these code line seens never reachable, can it be deleted?

2021-04-06 Thread xie cui
https://github.com/golang/go/blob/master/src/cmd/internal/obj/x86/asm6.go#L2192-L2210 if it can be delete i will send a pr! -- 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

[go-nuts] what is asm6 and span6 for?

2021-03-29 Thread xie cui
https://github.com/golang/go/blob/master/src/cmd/internal/obj/x86/asm6.go this file named asm6, and there is a func named span6, what is 6 for here? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

[go-nuts] tmp var in generic func?

2021-03-19 Thread xie cui
code: func printvar[T any](){ var t T fmt.Println("T", t) } printvar[int]() the function instantiate in cmd/compile will instantiate a generic func, func (check *Checker) instantiate(pos syntax.Pos, typ Type, targs []Type, poslist []syntax.Pos) (res Type) but i look into the implement,

[go-nuts] about untyped type?

2021-03-19 Thread xie cui
https://github.com/golang/go/blob/master/src/cmd/compile/internal/types2/universe.go#L58-L64 there are some basic type call untyped xxx? what is it mean? when will go compiler use them? can you show in example? -- You received this message because you are subscribed to the Google Groups "golang-

[go-nuts] about generic?

2021-03-18 Thread xie cui
https://github.com/golang/go/blob/master/src/cmd/compile/internal/noder/noder.go#L80 in my opion, after the call of check2, the generic type and generic func has convert to instantiation type or func, so the after this func the compiler works similiar to no generic compiler. am i right? -- You

[go-nuts] is func schedule always run on g0's stack?

2021-03-13 Thread xie cui
https://github.com/golang/go/blob/master/src/runtime/proc.go#L3086 -- 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 vi

[go-nuts] it seems the func NewSparseTreeHelper is not used by any code?

2021-03-13 Thread xie cui
https://github.com/golang/go/blob/master/src/cmd/compile/internal/ssa/sparsetreemap.go#L59 where is code call NewSparseTreeHelper, the comment says it is used by gc package, by i can not find it. please help? -- You received this message because you are subscribed to the Google Groups "golang-

[go-nuts] confuse about wakep?

2021-02-23 Thread xie cui
https://github.com/golang/go/blob/master/src/runtime/proc.go#L2441 why not change to if !atomic.Cas(&sched.nmspinning, 0, 1), it seems check sched.nmspinning no zero is unneccessary in logic, i am not sure, i guess it's about performence issue? -- You received this message because you are subs

[go-nuts] why need to cal the min path?

2021-02-17 Thread xie cui
*https://github.com/golang/go/blob/master/src/cmd/compile/internal/gc/escape.go#L1138* *why we need to cal the min path here?* -- 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

[go-nuts] what does ctxt param to typecheck means?

2021-02-12 Thread xie cui
https://github.com/golang/go/blob/master/src/cmd/compile/internal/gc/typecheck.go i feel had to understand the param ctxt to typecheck, could you explain to me? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and s

[go-nuts] what does capture by value means here?

2021-02-11 Thread xie cui
https://github.com/golang/go/blob/c31540364c2bc3bdb7800cfc344d85c2c9df3893/src/cmd/compile/internal/gc/main.go#L654 what is captured by value not esacpe means here, can you show a demo code? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To uns

[go-nuts] Re: compare of bytes or string?

2021-02-10 Thread xie cui
i look into map key compare key about string,it will use runtime·memequal, i thing the stra == strb will call memequal two. On Wednesday, February 10, 2021 at 6:12:18 PM UTC+8 xie cui wrote: > compare two byte slice,will convert to compare between two string, and my > question is how

[go-nuts] compare of bytes or string?

2021-02-10 Thread xie cui
compare two byte slice,will convert to compare between two string, and my question is how golang compare two string, i don't think that it just compare the len and then comapare bytes in string one byte by one byte, it should have some optimization?where is the code in compiler generate the com

[go-nuts] cas ABA problem?

2021-02-09 Thread xie cui
https://github.com/golang/go/blob/master/src/runtime/proc.go#L5926 how the cas in this line avoid ABA problem? -- 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 go

[go-nuts] generics of go?

2021-02-07 Thread xie cui
i try to run the generic code, i find two branch dev.go2go, dev.typeparams, the branch dev.go2go will translate generic to to no generic code and run it, as far as i know. but i find the commit in dev.typeparams is more friendly for me to read, so how can i run the generic code by using dev.ty

Re: [go-nuts] reflect and generic type or func?

2021-02-07 Thread xie cui
alid. You didn't define `a`, > so we don't know what its type should be. If you intended to add a `var a > String[int]`, for example, I would assume it should print something like > "String[int]". > > On Fri, Feb 5, 2021 at 4:05 PM xie cui wrote: > &g

[go-nuts] reflect and generic type or func?

2021-02-05 Thread xie cui
type String [T any] struct { str T } fmt.Println(reflect.TypeOf(a).Name()) in generic code, what is the output of relfect type name of generic type? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receivi

[go-nuts] golang memory model?

2021-02-01 Thread xie cui
here is the code: package main import "fmt" func main() { counter := 0 ch := make(chan struct{}, 1) closeCh := make(chan struct{}) go func() { counter++ //(1) ch <- struct{}{} }() go func() { _ = <-ch fmt.Println(counter) //(2) close(closeCh) }() _ =<-closeCh } is (1) happens before (2)? why

[go-nuts] Re: normal mode and starve mode of sync.Mutex and runtime mutex?

2021-01-31 Thread xie cui
mutex in sync package and runtime is different, mutex in runtime package is here, https://github.com/golang/go/blob/master/src/runtime/lock_futex.go#L46 i do not see there is a starving mode. On Monday, February 1, 2021 at 12:38:08 AM UTC+8 jake...@gmail.com wrote: > What makes you think it does

[go-nuts] normal mode and starve mode of sync.Mutex and runtime mutex?

2021-01-31 Thread xie cui
why mutex in runtime do not need starve mode? -- 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 view this discussion on

[go-nuts] explictly call make new cause space in heap?

2021-01-29 Thread xie cui
when i call make new explictly, does it mean the space must be in heap, in my mind, it still has chance to alloc in stack in some situation? my question is is it must be in heap, or in some case it can alloc in stack? -- You received this message because you are subscribed to the Google Groups

[go-nuts] Re: []byte and string convert?

2021-01-29 Thread xie cui
I mean convert using s := "abcefg" b := []byte(s) s2 := string(b) not convert using some unsafe.Pointer trick. On Friday, January 29, 2021 at 8:51:57 PM UTC+8 xie cui wrote: > does convert string to []byte, and convert []byte to string alway alloc > new space, and the new

[go-nuts] []byte and string convert?

2021-01-29 Thread xie cui
does convert string to []byte, and convert []byte to string alway alloc new space, and the new space is in heap? if it is not, please show some demo codes? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

[go-nuts] how linker decide addr of sym in a circle call?

2021-01-13 Thread xie cui
in linker, the code is like this: func f() { g() } func g() { f() } when gen binary code of func f, need func g, and gen g need f, how linker deal with this situation, and where is the code? is dynrelocsym do this job? it seem that it can deal with circles calls? -- You received this mes

[go-nuts] how linker work?

2021-01-01 Thread xie cui
in my mind, the main job of linker is to resolve symbols between .a files, is the right? my question: there a func named foo def in a.a, and there a func named bar in b.a, bar will call foo, before link the two file, i think in bar 's code has a instruction like: call foo, in C, before li

[go-nuts] would linker do some lto work? what kind of lto work it would do?

2020-12-30 Thread xie cui
would linker do some lto work? what kind of lto work it would do? -- 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 vi

[go-nuts] what is the scene to use mapaccess1_fat and mapaccess2_fat?

2020-12-15 Thread xie cui
https://github.com/golang/go/blob/master/src/runtime/map.go#L554 https://github.com/golang/go/blob/master/src/runtime/map.go#L562 -- 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, se

[go-nuts] equal func in type?

2020-12-15 Thread xie cui
https://github.com/golang/go/blob/master/src/reflect/type.go#L315 is this equal func generate by compiler, so where can i find the code generate this func? what is the rule for compare two object of same struct? -- You received this message because you are subscribed to the Google Groups "gola

[go-nuts] what is these code line for?

2020-12-08 Thread xie cui
https://github.com/golang/go/blob/master/src/runtime/proc.go#L248-L251 why these codes, it seem is unnecessary? -- 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 go

[go-nuts] net/http client about host, ip and connection?

2020-10-28 Thread xie cui
there a domain name domainA, has two ip address let's name ip1, ip2, when we use http client in golang to send a request, how it pickup ip address? it will use ip1 or ip2, what 's the stragegy? after many request send, the client must hold some connections to ip1, ip2 in connection pool, at the

[go-nuts] Re: save context, when switch goroutine?

2020-09-04 Thread xie cui
I find the mcall function! On Friday, September 4, 2020 at 6:13:54 PM UTC+8 xie cui wrote: > as we know, call function gogo can jump to other other goroutine. when > goroutine1 switch to goroutine2 it must save the current context of > goroutine1(sp pc. so). i can find the

[go-nuts] save context, when switch goroutine?

2020-09-04 Thread xie cui
as we know, call function gogo can jump to other other goroutine. when goroutine1 switch to goroutine2 it must save the current context of goroutine1(sp pc. so). i can find the function runtime·gosave to save current context, but i cann't find where the code call gosave, can some explain when

[go-nuts] about go tool link, where link get code(text segment) from *.o files and write it to executable files?

2020-08-30 Thread xie cui
i am trying to understand code of cmd/link, i need to know where linker get instructions(text segment in executable file) from *o file, and where linker write the binary data (.text segment) to excutable file(in linux it 's a elf file). -- You received this message because you are subscribed

[go-nuts] instruction gen in amd64, it iseems not the best choice?

2020-08-25 Thread xie cui
function: func test3(a int) int { return a * 3 + 4 } go version go1.13.5 darwin/amd64 generate instructions: LEAQ(AX)(AX*2), AX LEAQ4(AX), AX As far as i known,there a better choice LEAQ4(AX*3), AX Can it be optimized? -- You received this message because you are subscribed

[go-nuts] Re: what is empty block mean in ssa.Block?

2020-08-25 Thread xie cui
t; > On Monday, August 24, 2020 at 8:24:06 AM UTC-7, xie cui wrote: >> >> >> https://github.com/golang/go/blob/master/src/cmd/compile/internal/ssa/fuse.go#L130 >> it mention empty block here. in my knowledge, empty block would be >> len(b.Values) == 0, but it's n

[go-nuts] what is empty block mean in ssa.Block?

2020-08-24 Thread xie cui
https://github.com/golang/go/blob/master/src/cmd/compile/internal/ssa/fuse.go#L130 it mention empty block here. in my knowledge, empty block would be len(b.Values) == 0, but it's not. so what 's empty block means here. -- You received this message because you are subscribed to the Google Groups

[go-nuts] how golang choose instructions?

2020-08-22 Thread xie cui
we can find same dynamic programming algorithm(like BURS bottom rewriting system), to choose instructions in book about compiler technique. but as far as i know, it seems that golang just transform ast to ssa IR, then lower to machine instruction. how i find the min cost of instructions? -- Yo

[go-nuts] which pass of SSA will transform a ssa.Value(op=OpPhi) phi operations to a normal(not phi operations)?

2020-08-15 Thread xie cui
as we know, SSA has phi function, but the output of go tool compile -S xxx.go which do not contains a phi instruction. so i am trying to find out which SSA pass will transform a phi Op ssa.Value to normal ops? -- You received this message because you are subscribed to the Google Groups "golang

Re: [go-nuts] where is go code generate type info?

2020-08-14 Thread xie cui
i find the reference code in cmd/compile/internal/gc/reflect.go On Friday, August 14, 2020 at 8:52:54 PM UTC+8 Volker Dobler wrote: > On Friday, 14 August 2020 13:00:19 UTC+2, xie cui wrote: >> >> the return instance of reflect.TypeOf(some object) should be generate by >&g

Re: [go-nuts] where is go code generate type info?

2020-08-14 Thread xie cui
M UTC+8 xie cui wrote: > the return instance of reflect.TypeOf(some object) should be generate by > compiler, the type info which could be in elf files. i want to known where > compiler generate it. > > On Friday, August 14, 2020 at 5:08:30 PM UTC+8 Volker Dobler wrote: > >&

Re: [go-nuts] where is go code generate type info?

2020-08-14 Thread xie cui
the return instance of reflect.TypeOf(some object) should be generate by compiler, the type info which could be in elf files. i want to known where compiler generate it. On Friday, August 14, 2020 at 5:08:30 PM UTC+8 Volker Dobler wrote: > On Friday, 14 August 2020 08:15:03 UTC+2, xie

Re: [go-nuts] where is go code generate type info?

2020-08-13 Thread xie cui
.golang.org. > > V. > > > On Friday, 14 August 2020 04:44:57 UTC+2, xie cui wrote: >> >> >> the return of reflect.TypeOf should be generate by compile, i am trying >> to understand it, so i need to know where is code generate it in compiler. >> i need to k

Re: [go-nuts] where is go code generate type info?

2020-08-13 Thread xie cui
, August 13, 2020 at 10:47:28 PM UTC+8 Jan Mercl wrote: > On Thu, Aug 13, 2020 at 3:53 PM xie cui wrote: > > > ..., i know this type struct in generate by compiler, and i need to know > where is this code, and how to generate the struct fields and methods? > > To avoid the

[go-nuts] where is go code generate type info?

2020-08-13 Thread xie cui
package main import ( "fmt" "reflect" ) type Foo struct { A int } func (f *Foo) Test() { } func main() { f := &Foo{} t := reflect.TypeOf(f) fmt.Println(t) } when call reflect.TypeOf can get a struct desc the type, i know this type struct in generate by compiler, and i need to know where is th

[go-nuts] why the values in ssa block can be unordered?

2020-08-07 Thread xie cui
https://github.com/golang/go/blob/master/src/cmd/compile/internal/ssa/block.go#L60 in my opinion, the values are like instructions, why can it be unordered? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop r

[go-nuts] minimum linux kernel version that can run latest golang

2020-07-24 Thread xie cui
what is the minimum version of linux kernel that can run golang? -- 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 view

[go-nuts] what is walk(fn *Node) for?

2020-07-19 Thread xie cui
the go tool compile will call walk, what 's effect of this call? https://github.com/golang/go/blob/master/src/cmd/compile/internal/gc/walk.go#L20 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving em

[go-nuts] is golang(1.13)'s parser is a LL(1) parser?

2020-07-17 Thread xie cui
is golang(1.13)'s parser is a LL(1) parser? -- 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 view this discussion on t