Why this happens:
1. http.StripPrefix chang reuqest's path from /some/other/path to other/path
2. ServerMux.Handler will return 301 when cleanPath(r.URL.Path) !=
r.URL.Path
Link: https://github.com/golang/go/blob/go1.21.5/src/net/http/server.go#L2467
This seems to be a issue with ServerMux,
Our
Just my(newbie of GC) guess:
In the mark stage,
- GC find s1's finalizer and invoke scanobject to scan s1
https://github.com/golang/go/blob/go1.21.1/src/runtime/mgcmark.go#L391
https://github.com/golang/go/blob/go1.21.1/src/runtime/mfinal.go#L484
- then find s2 and queue it to be scanned
- th
Just my guess:
- when use IEE754, 18446744073709551615 will be actual stored as
18446744073709551616 (> 2<<64)
- so uint64(float64(18446744073709551615)) is overflow and undefined
Code:
// true
fmt.Println(uint64(float64(18446742974197923840)) ==
uint64(18446742974197923840))
// cannot convert f
I'm not sure what the best way is.
But I think you can refer to the existing solutions. For example gin, mux.
Link: https://github.com/gin-gonic/gin/blob/master/tree.go#L116
在2023年10月19日星期四 UTC+8 19:27:59 写道:
> Hi everyone. I'm building an api with net/http and I'm having trouble
> with url
Thanks for the guidance, the corresponding documentation helped me a lot
在2023年9月28日星期四 UTC+8 11:34:21 写道:
> On Tue, Sep 26, 2023 at 11:06 PM j2gg0s wrote:
> >
> > Related go code:
> > 22 //go:noinline
> > 23 func add(a, b int) int {
> > 24 defer func
e an enhancement
> proposal, that answers your question at the level of detail of
> specific instruction sequences.
>
> On Tue, Sep 26, 2023 at 9:10 PM j2gg0s wrote:
>
>> Thanks @lan
>>
>> Already read it, I actually started here.
>>
>> What I
grep "main.add.func1>:" -A 31
0047aee0 :
2.3 i just found 0x49b4e8 in rodata
2.4 So, What is stored at 0x49b4e8?
在2023年9月27日星期三 UTC+8 12:44:10 写道:
> On Tue, Sep 26, 2023 at 9:10 PM j2gg0s wrote:
> >
> > Already read it, I actually started here.
> >
> > What I
Thanks @lan
Already read it, I actually started here.
What I can't understand is x64 rip-relative address.
leaq132795(%rip), %rcx # 0x49b4e8
why 132795, and what is loaded into rcx
在2023年9月27日星期三 UTC+8 09:38:17 写道:
> On Tue, Sep 26, 2023 at 7:43 AM j2gg0s wrote:
> &
Append:
49b4e8: c0 ae 47 00 00 00 00 shrb $0, 71(%rsi)
在2023年9月26日星期二 UTC+8 22:43:27 写道:
> How to understand assmbly code ` 47ae26: 48 8d 0d bb 06 02 00
> leaq132795(%rip), %rcx # 0x49b4e8 `
>
> Go code:
> ```
> //go:noinline
> func add(a, b int) int {
> def
How to understand assmbly code ` 47ae26: 48 8d 0d bb 06 02 00
leaq132795(%rip), %rcx # 0x49b4e8 `
Go code:
```
//go:noinline
func add(a, b int) int {
defer func() {
fmt.Println(3)
}()
return a + b
}
func main() {
add(10, 20)
}
``
Thanks, solved my problem
在2023年1月17日星期二 UTC+8 00:49:03 写道:
> On Mon, Jan 16, 2023 at 8:43 AM j2gg0s wrote:
> >
> > As a newbie of golang's assembly, i cant understand why we MOVQ DX CX
> twice in runtime.gogo. WHY?
>
> I don't see any MOVQ DX, CX instructions
As a newbie of golang's assembly, i cant understand why we MOVQ DX CX twice
in runtime.gogo. WHY?
Source code:
```
255 // func gogo(buf *gobuf)
256 // restore state from Gobuf; longjmp
257 TEXT runtime·gogo(SB), NOSPLIT, $0-8
258 MOVQbuf+0(FP), BX // gobuf
12 matches
Mail list logo