Golang写时复制是否是原子性的?

Posted 衣舞晨风

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Golang写时复制是否是原子性的?相关的知识,希望对你有一定的参考价值。

验证代码:

package main

var (
	projectMap = make(map[string]*Project)
)

func main() 
	projectMap = getNewProject()


func getNewProject() map[string]*Project 
	items := make(map[string]*Project)

	item := new(Project)
	item.ID = "project_id"
	item.Name = "project_name"
	item.Desc = "project_desc"
	item.Status = "project_status"
	item.IsDeleted = 1

	items[item.ID] = item
	return items



type Project struct 
	ID        string `json:"id"`
	Name      string `json:"name"`
	Desc      string `json:"desc"`
	Status    string `json:"status"`
	IsDeleted uint8  `json:"is_deleted"`


汇编代码:

PS D:\\Code\\Golang\\github\\jiankunking\\cow-test> go tool compile -N -l -S main\\main.go
"".main STEXT size=75 args=0x0 locals=0x8 funcid=0x0 align=0x0                
        0x0000 00000 (main\\main.go:7)   TEXT    "".main(SB), ABIInternal, $8-0
        0x0000 00000 (main\\main.go:7)   CMPQ    SP, 16(R14)                   
        0x0004 00004 (main\\main.go:7)   PCDATA  $0, $-2                       
        0x0004 00004 (main\\main.go:7)   JLS     68                            
        0x0006 00006 (main\\main.go:7)   PCDATA  $0, $-1                       
        0x0006 00006 (main\\main.go:7)   SUBQ    $8, SP
        0x000a 00010 (main\\main.go:7)   MOVQ    BP, (SP)
        0x000e 00014 (main\\main.go:7)   LEAQ    (SP), BP
        0x0012 00018 (main\\main.go:7)   FUNCDATA        $0, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
        0x0012 00018 (main\\main.go:7)   FUNCDATA        $1, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
        0x0012 00018 (main\\main.go:8)   PCDATA  $1, $0
        0x0012 00018 (main\\main.go:8)   CALL    "".getNewProject(SB)
        0x0017 00023 (main\\main.go:8)   PCDATA  $0, $-2
        0x0017 00023 (main\\main.go:8)   CMPL    runtime.writeBarrier(SB), $0
        0x001e 00030 (main\\main.go:8)   NOP
        0x0020 00032 (main\\main.go:8)   JEQ     36
        0x0022 00034 (main\\main.go:8)   JMP     45
        0x0024 00036 (main\\main.go:8)   MOVQ    AX, "".projectMap(SB)
        0x002b 00043 (main\\main.go:8)   JMP     59
        0x002d 00045 (main\\main.go:8)   LEAQ    "".projectMap(SB), DI
        0x0034 00052 (main\\main.go:8)   CALL    runtime.gcWriteBarrier(SB)
        0x0039 00057 (main\\main.go:8)   JMP     59
        0x003b 00059 (main\\main.go:9)   PCDATA  $0, $-1
        0x003b 00059 (main\\main.go:9)   PCDATA  $1, $-1
        0x003b 00059 (main\\main.go:9)   MOVQ    (SP), BP
        0x003f 00063 (main\\main.go:9)   ADDQ    $8, SP
        0x0043 00067 (main\\main.go:9)   RET
        0x0044 00068 (main\\main.go:9)   NOP
        0x0044 00068 (main\\main.go:7)   PCDATA  $1, $-1
        0x0044 00068 (main\\main.go:7)   PCDATA  $0, $-2
        0x0044 00068 (main\\main.go:7)   CALL    runtime.morestack_noctxt(SB)
        0x0049 00073 (main\\main.go:7)   PCDATA  $0, $-1
        0x0049 00073 (main\\main.go:7)   JMP     0
        0x0000 49 3b 66 10 76 3e 48 83 ec 08 48 89 2c 24 48 8d  I;f.v>H...H.,$H.
        0x0010 2c 24 e8 00 00 00 00 83 3d 00 00 00 00 00 66 90  ,$......=.....f.
        0x0020 74 02 eb 09 48 89 05 00 00 00 00 eb 0e 48 8d 3d  t...H........H.=
        0x0030 00 00 00 00 e8 00 00 00 00 eb 00 48 8b 2c 24 48  ...........H.,$H
        0x0040 83 c4 08 c3 e8 00 00 00 00 eb b5                 ...........
        rel 19+4 t=7 "".getNewProject+0
        rel 25+4 t=14 runtime.writeBarrier+-1
        rel 39+4 t=14 "".projectMap+0
        rel 48+4 t=14 "".projectMap+0
        rel 53+4 t=7 runtime.gcWriteBarrier+0
        rel 69+4 t=7 runtime.morestack_noctxt+0
"".getNewProject STEXT size=405 args=0x0 locals=0x58 funcid=0x0 align=0x0
        0x0000 00000 (main\\main.go:11)  TEXT    "".getNewProject(SB), ABIInternal, $88-0
        0x0000 00000 (main\\main.go:11)  CMPQ    SP, 16(R14)
        0x0004 00004 (main\\main.go:11)  PCDATA  $0, $-2
        0x0004 00004 (main\\main.go:11)  JLS     395
        0x000a 00010 (main\\main.go:11)  PCDATA  $0, $-1
        0x000a 00010 (main\\main.go:11)  SUBQ    $88, SP
        0x000e 00014 (main\\main.go:11)  MOVQ    BP, 80(SP)
        0x0013 00019 (main\\main.go:11)  LEAQ    80(SP), BP
        0x0018 00024 (main\\main.go:11)  FUNCDATA        $0, gclocals·7d2d5fca80364273fb07d5820a76fef4(SB)
        0x0018 00024 (main\\main.go:11)  FUNCDATA        $1, gclocals·ce498490d28ef26bea44fe94811b42ae(SB)
        0x0018 00024 (main\\main.go:11)  MOVQ    $0, "".~r0+32(SP)
        0x0021 00033 (main\\main.go:12)  PCDATA  $1, $0
        0x0021 00033 (main\\main.go:12)  CALL    runtime.makemap_small(SB)
        0x0026 00038 (main\\main.go:12)  MOVQ    AX, "".items+40(SP)
        0x002b 00043 (main\\main.go:14)  LEAQ    type."".Project(SB), AX
        0x0032 00050 (main\\main.go:14)  PCDATA  $1, $1
        0x0032 00050 (main\\main.go:14)  CALL    runtime.newobject(SB)
        0x0037 00055 (main\\main.go:14)  MOVQ    AX, "".item+48(SP)
        0x003c 00060 (main\\main.go:15)  MOVQ    $10, 8(AX)
        0x0044 00068 (main\\main.go:15)  PCDATA  $0, $-2
        0x0044 00068 (main\\main.go:15)  CMPL    runtime.writeBarrier(SB), $0
        0x004b 00075 (main\\main.go:15)  JEQ     79
        0x004d 00077 (main\\main.go:15)  JMP     91
        0x004f 00079 (main\\main.go:15)  LEAQ    go.string."project_id"(SB), DX
        0x0056 00086 (main\\main.go:15)  MOVQ    DX, (AX)
        0x0059 00089 (main\\main.go:15)  JMP     108
        0x005b 00091 (main\\main.go:15)  MOVQ    AX, DI
        0x005e 00094 (main\\main.go:15)  LEAQ    go.string."project_id"(SB), DX
        0x0065 00101 (main\\main.go:15)  CALL    runtime.gcWriteBarrierDX(SB)
        0x006a 00106 (main\\main.go:15)  JMP     108
        0x006c 00108 (main\\main.go:16)  PCDATA  $0, $-1
        0x006c 00108 (main\\main.go:16)  MOVQ    "".item+48(SP), DX
        0x0071 00113 (main\\main.go:16)  TESTB   AL, (DX)
        0x0073 00115 (main\\main.go:16)  MOVQ    $12, 24(DX)
        0x007b 00123 (main\\main.go:16)  LEAQ    16(DX), DI
        0x007f 00127 (main\\main.go:16)  PCDATA  $0, $-2
        0x007f 00127 (main\\main.go:16)  CMPL    runtime.writeBarrier(SB), $0
        0x0086 00134 (main\\main.go:16)  JEQ     138
        0x0088 00136 (main\\main.go:16)  JMP     151
        0x008a 00138 (main\\main.go:16)  LEAQ    go.string."project_name"(SB), SI
        0x0091 00145 (main\\main.go:16)  MOVQ    SI, 16(DX)
        0x0095 00149 (main\\main.go:16)  JMP     167
        0x0097 00151 (main\\main.go:16)  LEAQ    go.string."project_name"(SB), DX
        0x009e 00158 (main\\main.go:16)  NOP
        0x00a0 00160 (main\\main.go:16)  CALL    runtime.gcWriteBarrierDX(SB)
        0x00a5 00165 (main\\main.go:16)  JMP     167
        0x00a7 00167 (main\\main.go:17)  PCDATA  $0, $-1
        0x00a7 00167 (main\\main.go:17)  MOVQ    "".item+48(SP), DX
        0x00ac 00172 (main\\main.go:17)  TESTB   AL, (DX)
        0x00ae 00174 (main\\main.go:17)  MOVQ    $12, 40(DX)
        0x00b6 00182 (main\\main.go:17)  LEAQ    32(DX), DI
        0x00ba 00186 (main\\main.go:17)  PCDATA  $0, $-2
        0x00ba 00186 (main\\main.go:17)  CMPL    runtime.writeBarrier(SB), $0
        0x00c1 00193 (main\\main.go:17)  JEQ     197
        0x00c3 00195 (main\\main.go:17)  JMP     210
        0x00c5 00197 (main\\main.go:17)  LEAQ    go.string."project_desc"(SB), SI
        0x00cc 00204 (main\\main.go:17)  MOVQ    SI, 32(DX)
        0x00d0 00208 (main\\main.go:17)  JMP     226
        0x00d2 00210 (main\\main.go:17)  LEAQ    go.string."project_desc"(SB), DX
        0x00d9 00217 (main\\main.go:17)  CALL    runtime.gcWriteBarrierDX(SB)
        0x00de 00222 (main\\main.go:17)  NOP
        0x00e0 00224 (main\\main.go:17)  JMP     226
        0x00e2 00226 (main\\main.go:18)  PCDATA  $0, $-1
        0x00e2 00226 (main\\main.go:18)  MOVQ    "".item+48(SP), DX
        0x00e7 00231 (main\\main.go:18)  TESTB   AL, (DX)
        0x00e9 00233 (main\\main.go:18)  MOVQ    $14, 56(DX)
        0x00f1 00241 (main\\main.go:18)  LEAQ    48(DX), DI
        0x00f5 00245 (main\\main.go:18)  PCDATA  $0, $-2
        0x00f5 00245 (main\\main.go:18)  CMPL    runtime.writeBarrier(SB), $0
        0x00fc 00252 (main\\main.go:18)  JEQ     258
        0x00fe 00254 (main\\main.go:18)  NOP
        0x0100 00256 (main\\main.go:18)  JMP     271
        0x0102 00258 (main\\main.go:18)  LEAQ    go.string."project_status"(SB), SI
        0x0109 00265 (main\\main.go:18)  MOVQ    SI, 48(DX)
        0x010d 00269 (main\\main.go:18)  JMP     285
        0x010f 00271 (main\\main.go:18)  LEAQ    go.string."project_status"(SB), DX
        0x0116 00278 (main\\main.go:18)  CALL    runtime.gcWriteBarrierDX(SB)
        0x011b 00283 (main\\main.go:18)  JMP     285
        0x011d 00285 (main\\main.go:19)  PCDATA  $0, $-1
        0x011d 00285 (main\\main.go:19)  MOVQ    "".item+48(SP), DX
        0x0122 00290 (main\\main.go:19)  TESTB   AL, (DX)
        0x0124 00292 (main\\main.go:19)  MOVB    $1, 64(DX)
        0x0128 00296 (main\\main.go:21)  MOVQ    "".item+48(SP), DX
        0x012d 00301 (main\\main.go:21)  TESTB   AL, (DX)
        0x012f 00303 (main\\main.go:21)  MOVQ    (DX), CX
        0x0132 00306 (main\\main.go:21)  MOVQ    8(DX), DI
        0x0136 00310 (main\\main.go:21)  MOVQ    CX, ""..autotmp_3+64(SP)
        0x013b 00315 (main\\main.go:21)  MOVQ    DI, ""..autotmp_3+72(SP)
        0x0140 00320 (main\\main.go:21)  MOVQ    "".items+40(SP), BX
        0x0145 00325 (main\\main.go:21)  LEAQ    type.map[string]*"".Project(SB), AX
        0x014c 00332 (main\\main.go:21)  PCDATA  $1, $2
        0x014c 00332 (main\\main.go:21)  CALL    runtime.mapassign_faststr(SB)
        0x0151 00337 (main\\main.go:21)  MOVQ    AX, ""..autotmp_4+56(SP)
        0x0156 00342 (main\\main.go:21)  TESTB   AL, (AX)
        0x0158 00344 (main\\main.go:21)  MOVQ    "".item+48(SP), DX
        0x015d 00349 (main\\main.go:21)  PCDATA  $0, $-2
        0x015d 00349 (main\\main.go:21)  CMPL    runtime.writeBarrier(SB), $0
        0x0164 00356 (main\\main.go:21)  JEQ     360
        0x0166 00358 (main\\main.go:21)  JMP     365
        0x0168 00360 (main\\main.go:21)  MOVQ    DX, (AX)
        0x016b 00363 (main\\main.go:21)  JMP     375
        0x016d 00365 (main\\main.go:21)  MOVQ    AX, DI
        0x0170 00368 (main\\main.go:21)  CALL    runtime.gcWriteBarrierDX(SB)
        0x0175 00373 (main\\main.go:21)  JMP     375
        0x0177 00375 (main\\main.go:22)  PCDATA  $0, $-1
        0x0177 00375 (main\\main.go:22)  MOVQ    "".items+40(SP), AX
        0x017c 00380 (main\\main.go:22)  MOVQ    AX, "".~r0+32(SP)
        0x0181 00385 (main\\main.go:22)  MOVQ    80(SP), BP
        0x0186 00390 (main\\main.go:22)  ADDQ    $88, SP
        0x018a 00394 (main\\main.go:22)  RET
        0x018b 00395 (main\\main.go:22)  NOP
        0x018b 00395 (main\\main.go:11)  PCDATA  $1, $-1
        0x018b 00395 (main\\main.go:11)  PCDATA  $0, $-2
        0x018b 00395 (main\\main.go:11)  CALL    runtime.morestack_noctxt(SB)
        0x0190 00400 (main\\main.go:11)  PCDATA  $0, $-1
        0x0190 00400 (main\\main.go:11)  JMP     0
        0x0000 49 3b 66 10 0f 86 81 01 00 00 48 83 ec 58 48 89  I;f.......H..XH.
        0x0010 6c 24 50 48 8d 6c 24 50 48 c7 44 24 20 00 00 00  l$PH.l$PH.D$ ...
        0x0020 00 e8 00 00 00 00 48 89 44 24 28 48 8d 05 00 00  ......H.D$(H....
        0x0030 00 00 e8 00 00 00 00 48 89 44 24 30 48 c7 40 08  .......H.D$0H.@.
        0x0040 0a 00 00 00 83 3d 00 00 00 00 00 74 02 eb 0c 48  .....=.....t...H
        0x0050 8d 15 00 00 00 00 48 89 10 eb 11 48 89 c7 48 8d  ......H....H..H.
        0x0060 15 00 00 00 00 e8 00 00 00 00 eb 00 48 8b 54 24  ............H.T$
        0x0070 30 84 02 48 c7 42 18 0c 00 00 00 48 8d 7a 10 83  0..H.B.....H.z..
        0x0080 3d 00 00 00 00 00 74 02 eb 0d 48 8d 35 00 00 00  =.....t...H.5...
        0x0090 00 48 89 72 10 eb 10 48 8d 15 00 00 00 00 66 90  .H.r...H......f.
        0x00a0 e8 00 00 00 00 eb 00 48 8b 54 24 30 84 02 48 c7  .......H.T$0..H.
        0x00b0 42 28 0c 00 00 00 48 8d 7a 20 83 3d 00 00 00 00  B(....H.z .=....
        0x00c0 00 74 02 eb 0d 48 8d 35 00 00 00 00 48 89 72 20  .t...H.5....H.r
        0x00d0 eb 10 48 8d 15 00 00 00 00 e8 00 00 00 00 66 90  ..H...........f.
        0x00e0 eb 00 48 8b 54 24 30 84 02 48 c7 42 38 0e 00 00  ..H.T$0..H.B8...
        0x00f0 00 48 8d 7a 30 83 3d 00 00 00 00 00 74 04 66 90  .H.z0.=.....t.f.
        0x0100 eb 0d 48 8d 35 00 00 00 00 48 89 72 30 eb 0e 48  ..H.5....H.r0..H
        0x0110 8d 15 00 00 00 00 e8 00 00 00 00 eb 00 48 8b 54  .............H.T
        0x0120 24 30 84 02 c6 42 40 01 48 8b 54 24 30 84 02 48  $0...B@.H.T$0..H
        0x0130 8b 0a 48 8b 7a 08 48 89 4c 24 40 48 89 7c 24 48  ..H.z.H.L$@H.|$H
        0x0140 48 8b 5c 24 28 48 8d 05 00 00 00 00 e8 00 00 00  H.\\$(H..........
        0x0150 00 48 89 44 24 38 84 00 48 8b 54 24 30 83 3d 00  .H.D$8..H.T$0.=.
        0x0160 00 00 00 00 74 02 eb 05 48 89 10 eb 0a 48 89 c7  ....t...H....H..
        0x0170 e8 00 00 00 00 eb 00 48 8b 44 24 28 48 89 44 24  .......H.D$(H.D$
        0x0180 20 48 8b 6c 24 50 48 83 c4 58 c3 e8 00 00 00 00   H.l$PH..X......
        0x0190 e9 6b fe ff ff                                   .k...
        rel 34+4 t=7 runtime.makemap_small+0
        rel 46+4 t=14 type."".Project+0
        rel 51+4 t=7 runtime.newobject+0
        rel 70+4 t=14 runtime.writeBarrier+-1
        rel 82+4 t=14 go.string."project_id"+0
        rel 97+4 t=14 go.string."project_id"+0
        rel 102+4 t=7 runtime.gcWriteBarrierDX+0
        rel 129+4 t=14 runtime.writeBarrier+-1
        rel 141+4 t=14 go.string."project_name"+0
        rel 154+4 t=14 go.string."project_name"+0
        rel 161+4 t=7 runtime.gcWriteBarrierDX+0
        rel 188+4 t=14 runtime.writeBarrier+-1
        rel 200+4 t=14 go.string."project_desc"+0
        rel 213+4 t=14 go.string."project_desc"+0
        rel 218+4 t=7 runtime.gcWriteBarrierDX+0
        rel 247+4 t=14 runtime.writeBarrier+-1
        rel 261+4 t=14 go.string."project_status"+0
        rel 274+4 t=14 go.string."project_status"+0
        rel 279+4 t=7 runtime.gcWriteBarrierDX+0
        rel 328+4 t=14 type.map[string]*"".Project+0
        rel 333+4 t=7 runtime.mapassign_faststr+0
        rel 351+4 t=14 runtime.writeBarrier+-1
        rel 369+4 t=7 runtime.gcWriteBarrierDX+0
        rel 396+4 t=7 runtime.morestack_noctxt+0
"".init STEXT size=75 args=0x0 locals=0x8 funcid=0x0 align=0x0
        0x0000 00000 (main\\main.go:4)   TEXT    "".init(SB), ABIInternal, $8-0
        0x0000 00000 (main\\main.go:4)   CMPQ    SP, 16(R14)
        0x0004 00004 (main\\main.go:4)   PCDATA  $0, $-2
        0x0004 00004 (main\\main.go:4)   JLS     68
        0x0006 00006 (main\\main.go:4)   PCDATA  $0, $-1
        0x0006 00006 (main\\main.go:4)   SUBQ    $8, SP
        0x000a 00010 (main\\main.go:4)   MOVQ    BP, (SP)
        0x000e 00014 (main\\main.go:4)   LEAQ    (SP), BP
        0x0012 00018 (main\\main.go:4)   FUNCDATA        $0, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
        0x0012 00018 (main\\main.go:4)   FUNCDATA        $1, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
        0x0012 00018 (main\\main.go:4)   PCDATA  $1, $0
        0x0012 00018 (main\\main.go:4)   CALL    runtime.makemap_small(SB)
        0x0017 00023 (main\\main.go:4)   PCDATA  $0, $-2
        0x0017 00023 (main\\main.go:4)   CMPL    runtime.writeBarrier(SB), $0
        0x001e 00030 (main\\main.go:4)   NOP
        0x0020 00032 (main\\main.go:4)   JEQ     36
        0x0022 00034 (main\\main.go:4)   JMP     45
        0x0024 00036 (main\\main.go:4)   MOVQ    AX, "".projectMap(SB)
        0x002b 00043 (main\\main.go:4)   JMP     59
        0x002d 00045 (main\\main.go:4)   LEAQ    "".projectMap(SB), DI
        0x0034 00052 (main\\main.go:4)   CALL    runtime.gcWriteBarrier(SB)
        0x0039 00057 (main\\main.go:4)   JMP     59
        0x003b 00059 (main\\main.go:4)   PCDATA  $0, $-1
        0x003b 00059 (main\\main.go:4)   PCDATA  $1, $-1
        0x003b 00059 (main\\main.go:4)   MOVQ    (SP), BP
        0x003f 00063 (main\\main.go:4)   ADDQ    $8, SP
        0x0043 00067 (main\\main.go:4)   RET
        0x0044 00068 (main\\main.go:4)   NOP
        0x0044 00068 (main\\main.go:4)   PCDATA  $1, $-1
        0x0044 00068 (main\\main.go:4)   PCDATA  $0, $-2
        0x0044 00068 (main\\main.go:4)   CALL    runtime.morestack_noctxt(SB)
        0x0049 00073 (main\\main.go:4)   PCDATA  $0, $-1
        0x0049 00073 (main\\main.go:4)   JMP     0
        0x0000 49 3b 66 10 76 3e 48 83 ec 08 48 89 2c 24 48 8d  I;f.v>H...H.,$H.
        0x0010 2c 24 e8 00 00 00 00 83 3d 00 00 00 00 00 66 90  ,$......=.....f.
        0x0020 74 02 eb 09 48 89 05 00 00 00 00 eb 0e 48 8d 3d  t...H........H.=
        0x0030 00 00 00 00 e8 00 00 00 00 eb 00 48 8b 2c 24 48  ...........H.,$H
        0x0040 83 c4 08 c3 e8 00 00 00 00 eb b5                 ...........
        rel 19+4 t=7 runtime.makemap_small+0
        rel 25+4 t=14 runtime.writeBarrier+-1
        rel 39+4 t=14 "".projectMap+0
        rel 48+4 t=14 "".projectMap+0
        rel 53+4 t=7 runtime.gcWriteBarrier+0
        rel 69+4 t=7 runtime.morestack_noctxt+0
type..eq."".Project STEXT dupok size=646 args=0x10 locals=0x78 funcid=0x0 align=0x0
        0x0000 00000 (<autogenerated>:1)        TEXT    type..eq."".Project(SB), DUPOK|ABIInternal, $120-16
        0x0000 00000 (<autogenerated>:1)        CMPQ    SP, 16(R14)
        0x0004 00004 (<autogenerated>:1)        PCDATA  $0, $-2
        0x0004 00004 (<autogenerated>:1)        JLS     616
        0x000a 00010 (<autogenerated>:1)        PCDATA  $0, $-1
        0x000a 00010 (<autogenerated>:1)        SUBQ    $120, SP
        0x000e 00014 (<autogenerated>:1)        MOVQ    BP, 112(SP)
        0x0013 00019 (<autogenerated>:1)        LEAQ    112(SP), BP
        0x0018 00024 (<autogenerated>:1)        FUNCDATA        $0, gclocals·dc9b0298814590ca3ffc3a889546fc8b(SB)
        0x0018 00024 (<autogenerated>:1)        FUNCDATA        $1, gclocals·6c80e7c7d827a5ab4457c7bd9e35d7d4(SB)
        0x0018 00024 (<autogenerated>:1)        FUNCDATA        $5, type..eq."".Project.arginfo1(SB)
        0x0018 00024 (<autogenerated>:1)        MOVQ    AX, "".p+128(SP)
        0x0020 00032 (<autogenerated>:1)        MOVQ    BX, "".q+136(SP)
        0x0028 00040 (<autogenerated>:1)        MOVB    $0, "".r+30(SP)
        0x002d 00045 (<autogenerated>:1)        MOVQ    "".p+128(SP), DX
        0x0035 00053 (<autogenerated>:1)        MOVQ    8(DX), DX
        0x0039 00057 (<autogenerated>:1)        MOVQ    DX, ""..autotmp_3+40(SP)
        0x003e 00062 (<autogenerated>:1)        MOVQ    "".q+136(SP), DX
        0x0046 00070 (<autogenerated>:1)        MOVQ    8(DX), DX
        0x004a 00074 (<autogenerated>:1)        MOVQ    DX, ""..autotmp_4+32(SP)
        0x004f 00079 (<autogenerated>:1)        CMPQ    ""..autotmp_3+40(SP), DX
        0x0054 00084 (<autogenerated>:1)        JEQ     91
        0x0056 00086 (<autogenerated>:1)        JMP     592
        0x005b 00091 (<autogenerated>:1)        JMP     93
        0x005d 00093 (<autogenerated>:1)        MOVQ    "".p+128(SP), DX
        0x0065 00101 (<autogenerated>:1)        MOVQ    24(DX), DX
        0x0069 00105 (<autogenerated>:1)        MOVQ    DX, ""..autotmp_4+32(SP)
        0x006e 00110 (<autogenerated>:1)        MOVQ    "".q+136(SP), DX
        0x0076 00118 (<autogenerated>:1)        MOVQ    24(DX), DX
        0x007a 00122 (<autogenerated>:1)        MOVQ    DX, ""..autotmp_3+40(SP)
        0x007f 00127 (<autogenerated>:1)        NOP
        0x0080 00128 (<autogenerated>:1)        CMPQ    ""..autotmp_4+32(SP), DX
        0x0085 00133 (<autogenerated>:1)        JEQ     140
        0x0087 00135 (<autogenerated>:1)        JMP     590
        0x008c 00140 (<autogenerated>:1)        JMP     142
        0x008e 00142 (<autogenerated>:1)        MOVQ    "".p+128(SP), DX
        0x0096 00150 (<autogenerated>:1)        MOVQ    40(DX), DX
        0x009a 00154 (<autogenerated>:1)        MOVQ    DX, ""..autotmp_3+40(SP)
        0x009f 00159 (<autogenerated>:1)        MOVQ    "".q+136(SP), DX
        0x00a7 00167 (<autogenerated>:1)        MOVQ    40(DX), DX
        0x00ab 00171 (<autogenerated>:1)        MOVQ    DX, ""..autotmp_4+32(SP)
        0x00b0 00176 (<autogenerated>:1)        CMPQ    ""..autotmp_3+40(SP), DX
        0x00b5 00181 (<autogenerated>:1)        JEQ     188
        0x00b7 00183 (<autogenerated>:1)        JMP     588
        0x00bc 00188 (<autogenerated>:1)        JMP     190
        0x00be 00190 (<autogenerated>:1)        MOVQ    "".p+128(SP), DX
        0x00c6 00198 (<autogenerated>:1)        MOVQ    56(DX), DX
        0x00ca 00202 (<autogenerated>:1)        MOVQ    DX, ""..autotmp_4+32(SP)
        0x00cf 00207 (<autogenerated>:1)        MOVQ    "".q+136(SP), DX
        0x00d7 00215 (<autogenerated>:1)        MOVQ    56(DX), DX
        0x00db 00219 (<autogenerated>:1)        MOVQ    DX, ""..autotmp_3+40(SP)
        0x00e0 00224 (<autogenerated>:1)        CMPQ    ""..autotmp_4+32(SP), DX
        0x00e5 00229 (<autogenerated>:1)        JEQ     236
        0x00e7 00231 (<autogenerated>:1)        JMP     586
        0x00ec 00236 (<autogenerated>:1)        JMP     238
        0x00ee 00238 (<autogenerated>:1)        MOVQ    "".p+128(SP), DX
        0x00f6 00246 (<autogenerated>:1)        MOVQ    "".q+136(SP), SI
        0x00fe 00254 (<autogenerated>:1)        MOVBLZX 64(DX), DX
        0x0102 00258 (<autogenerated>:1)        CMPB    64(SI), DL
        0x0105 00261 (<autogenerated>:1)        JEQ     268
        0x0107 00263 (<autogenerated>:1)        JMP     584
        0x010c 00268 (<autogenerated>:1)        MOVQ    "".p+128(SP), DX
        0x0114 00276 (<autogenerated>:1)        MOVQ    8(DX), DX
        0x0118 00280 (<autogenerated>:1)        MOVQ    DX, ""..autotmp_3+40(SP)
        0x011d 00285 (<autogenerated>:1)        MOVQ    "".p+128(SP), DX
        0x0125 00293 (<autogenerated>:1)        MOVQ    (DX), DX
        0x0128 00296 (<autogenerated>:1)        MOVQ    DX, ""..autotmp_6+72(SP)
        0x012d 00301 (<autogenerated>:1)        MOVQ    "".q+136(SP), DX
        0x0135 00309 (<autogenerated>:1)        MOVQ    (DX), BX
        0x0138 00312 (<autogenerated>:1)        MOVQ    BX, ""..autotmp_7+64(SP)
        0x013d 00317 (<autogenerated>:1)        MOVQ    ""..autotmp_3+40(SP), CX
        0x0142 00322 (<autogenerated>:1)        MOVQ    ""..autotmp_6+72(SP), AX
        0x0147 00327 (<autogenerated>:1)        PCDATA  $1, $0
        0x0147 00327 (<autogenerated>:1)        CALL    runtime.memequal(SB)
        0x014c 00332 (<autogenerated>:1)        MOVB    AL, ""..autotmp_5+31(SP)
        0x0150 00336 (<autogenerated>:1)        TESTB   AL, AL
        0x0152 00338 (<autogenerated>:1)        JNE     345
        0x0154 00340 (<autogenerated>:1)        JMP     582
        0x0159 00345 (<autogenerated>:1)        PCDATA  $1, $-1
        0x0159 00345 (<autogenerated>:1)        JMP     347
        0x015b 00347 (<autogenerated>:1)        MOVQ    "".p+128(SP), DX
        0x0163 00355 (<autogenerated>:1)        MOVQ    24(DX), DX
        0x0167 00359 (<autogenerated>:1)        MOVQ    DX, ""..autotmp_3+40(SP)
        0x016c 00364 (<autogenerated>:1)        MOVQ    "".p+128(SP), DX
        0x0174 00372 (<autogenerated>:1)        MOVQ    16(DX), DX
        0x0178 00376 (<autogenerated>:1)        MOVQ    DX, ""..autotmp_8+56(SP)
        0x017d 00381 (<autogenerated>:1)        MOVQ    "".q+136(SP), DX
        0x0185 00389 (<autogenerated>:1)        MOVQ    16(DX), BX
        0x0189 00393 (<autogenerated>:1)        MOVQ    BX, ""..autotmp_9+48(SP)
        0x018e 00398 (<autogenerated>:1)        MOVQ    ""..autotmp_3+40(SP), CX
        0x0193 00403 (<autogenerated>:1)        MOVQ    ""..autotmp_8+56(SP), AX
        0x0198 00408 (<autogenerated>:1)        PCDATA  $1, $0
        0x0198 00408 (<autogenerated>:1)        CALL    runtime.memequal(SB)
        0x019d 00413 (<autogenerated>:1)        MOVB    AL, ""..autotmp_5+31(SP)
        0x01a1 00417 (<autogenerated>:1)        TESTB   AL, AL
        0x01a3 00419 (<autogenerated>:1)        JNE     426
        0x01a5 00421 (<autogenerated>:1)        JMP     580
        0x01aa 00426 (<autogenerated>:1)        PCDATA  $1, $-1
        0x01aa 00426 (<autogenerated>:1)        JMP     428
        0x01ac 00428 (<autogenerated>:1)        MOVQ    "".p+128(SP), DX
        0x01b4 00436 (<autogenerated>:1)        MOVQ    40(DX), DX
        0x01b8 00440 (<autogenerated>:1)        MOVQ    DX, ""..autotmp_3+40(SP)
        0x01bd 00445 (<autogenerated>:1)        MOVQ    "".p+128(SP), DX
        0x01c5 00453 (<autogenerated>:1)        MOVQ    32(DX), DX
        0x01c9 00457 (<autogenerated>:1)        MOVQ    DX, ""..autotmp_10+104(SP)
        0x01ce 00462 (<autogenerated>:1)        MOVQ    "".q+136(SP), DX
        0x01d6 00470 (<autogenerated>:1)        MOVQ    32(DX), BX
        0x01da 00474 (<autogenerated>:1)        MOVQ    BX, ""..autotmp_11+96(SP)
        0x01df 00479 (<autogenerated>:1)        MOVQ    ""..autotmp_3+40(SP), CX
        0x01e4 00484 (<autogenerated>:1)        MOVQ    ""..autotmp_10+104(SP), AX
        0x01e9 00489 (<autogenerated>:1)        PCDATA  $1, $0
        0x01e9 00489 (<autogenerated>:1)        CALL    runtime.memequal(SB)
        0x01ee 00494 (<autogenerated>:1)        MOVB    AL, ""..autotmp_5+31(SP)
        0x01f2 00498 (<autogenerated>:1)        TESTB   AL, AL
        0x01f4 00500 (<autogenerated>:1)        JNE     504
        0x01f6 00502 (<autogenerated>:1)        JMP     578
        0x01f8 00504 (<autogenerated>:1)        PCDATA  $1, $-1
        0x01f8 00504 (<autogenerated>:1)        JMP     506
        0x01fa 00506 (<autogenerated>:1)        MOVQ    "".p+128(SP), DX
        0x0202 00514 (<autogenerated>:1)        MOVQ    56(DX), DX
        0x0206 00518 (<autogenerated>:1)        MOVQ    DX, ""..autotmp_3+40(SP)
        0x020b 00523 (<autogenerated>:1)        MOVQ    "".p+128(SP), DX
        0x0213 00531 (<autogenerated>:1)        MOVQ    48(DX), DX
        0x0217 00535 (<autogenerated>:1)        MOVQ    DX, ""..autotmp_12+88(SP)
        0x021c 00540 (<autogenerated>:1)        MOVQ    "".q+136(SP), DX
        0x0224 00548 (<autogenerated>:1)        MOVQ    48(DX), BX
        0x0228 00552 (<autogenerated>:1)        MOVQ    BX, ""..autotmp_13+80(SP)
        0x022d 00557 (<autogenerated>:1)        MOVQ    ""..autotmp_3+40(SP), CX
        0x0232 00562 (<autogenerated>:1)        MOVQ    ""..autotmp_12+88(SP), AX
        0x0237 00567 (<autogenerated>:1)        PCDATA  $1, $1
        0x0237 00567 (<autogenerated>:1)        CALL    runtime.memequal(SB)
        0x023c 00572 (<autogenerated>:1)        MOVB    AL, "".r+30(SP)
        0x0240 00576 (<autogenerated>:1)        JMP     601
        0x0242 00578 (<autogenerated>:1)        PCDATA  $1, $-1
        0x0242 00578 (<autogenerated>:1)        JMP     594
        0x0244 00580 (<autogenerated>:1)        JMP     594
        0x0246 00582 (<autogenerated>:1)        JMP     594
        0x0248 00584 (<autogenerated>:1)        JMP     594
        0x024a 00586 (<autogenerated>:1)        JMP     594
        0x024c 00588 (<autogenerated>:1)        JMP     594
        0x024e 00590 (<autogenerated>:1)        JMP     594
        0x0250 00592 (<autogenerated>:1)        JMP     594
        0x0252 00594 (<autogenerated>:1)        MOVB    $0, "".r+30(SP)
        0x0257 00599 (<autogenerated>:1)        JMP     601
        0x0259 00601 (<autogenerated>:1)        MOVBLZX "".r+30(SP), AX
        0x025e 00606 (<autogenerated>:1)        MOVQ    112(SP), BP
        0x0263 00611 (<autogenerated>:1)        ADDQ    $120, SP
        0x0267 00615 (<autogenerated>:1)        RET
        0x0268 00616 (<autogenerated>:1)        NOP
        0x0268 00616 (<autogenerated>:1)        PCDATA  $1, $-1
        0x0268 00616 (<autogenerated>:1)        PCDATA  $0, $-2
        0x0268 00616 (<autogenerated>:1)        MOVQ    AX, 8(SP)
        0x026d 00621 (<autogenerated>:1)        MOVQ    BX, 16(SP)
        0x0272 00626 (<autogenerated>:1)        CALL    runtime.morestack_noctxt(SB)
        0x0277 00631 (<autogenerated>:1)        MOVQ    8(SP), AX
        0x027c 00636 (<autogenerated>:1)        MOVQ    16(SP), BX
        0x0281 00641 (<autogenerated>:1)        PCDATA  $0, $-1
        0x0281 00641 (<autogenerated>:1)        JMP     0
        0x0000 49 3b 66 10 0f 86 5e 02 00 00 48 83 ec 78 48 89  I;f...^...H..xH.
        0x0010 6c 24 70 48 8d 6c 24 70 48 89 84 24 80 00 00 00  l$pH.l$pH..$....
        0x0020 48 89 9c 24 88 00 00 00 c6 44 24 1e 00 48 8b 94  H..$.....D$..H..
        0x0030 24 80 00 00 00 48 8b 52 08 48 89 54 24 28 48 8b  $....H.R.H.T$(H.
        0x0040 94 24 88 00 00 00 48 8b 52 08 48 89 54 24 20 48  .$....H.R.H.T$ H
        0x0050 39 54 24 28 74 05 e9 f5 01 00 00 eb 00 48 8b 94  9T$(t........H..
        0x0060 24 80 00 00 00 48 8b 52 18 48 89 54 24 20 48 8b  $....H.R.H.T$ H.
        0x0070 94 24 88 00 00 00 48 8b 52 18 48 89 54 24 28 90  .$....H.R.H.T$(.
        0x0080 48 39 54 24 20 74 05 e9 c2 01 00 00 eb 00 48 8b  H9T$ t........H.
        0x0090 94 24 80 00 00 00 48 8b 52 28 48 89 54 24 28 48  .$....H.R(H.T$(H
        0x00a0 8b 94 24 88 00 00 00 48 8b 52 28 48 89 54 24 20  ..$....H.R(H.T$
        0x00b0 48 39 54 24 28 74 05 e9 90 01 00 00 eb 00 48 8b  H9T$(t........H.
        0x00c0 94 24 80 00 00 00 48 8b 52 38 48 89 54 24 20 48  .$....H.R8H.T$ H
        0x00d0 8b 94 24 88 00 00 00 48 8b 52 38 48 89 54 24 28  ..$....H.R8H.T$(
        0x00e0 48 39 54 24 20 74 05 e9 5e 01 00 00 eb 00 48 8b  H9T$ t..^.....H.
        0x00f0 94 24 80 00 00 00 48 8b b4 24 88 00 00 00 0f b6  .$....H..$......
        0x0100 52 40 38 56 40 74 05 e9 3c 01 00 00 48 8b 94 24  R@8V@t..<...H..$
        0x0110 80 00 00 00 48 8b 52 08 48 89 54 24 28 48 8b 94  ....H.R.H.T$(H..
        0x0120 24 80 00 00 00 48 8b 12 48 89 54 24 48 48 8b 94  $....H..H.T$HH..
        0x0130 24 88 00 00 00 48 8b 1a 48 89 5c 24 40 48 8b 4c  $....H..H.\\$@H.L
        0x0140 24 28 48 8b 44 24 48 e8 00 00 00 00 88 44 24 1f  $(H.D$H......D$.
        0x0150 84 c0 75 05 e9 ed 00 00 00 eb 00 48 8b 94 24 80  ..u........H..$.
        0x0160 00 00 00 48 8b 52 18 48 89 54 24 28 48 8b 94 24  ...H.R.H.T$(H..$
        0x0170 80 00 00 00 48 8b 52 10 48 89 54 24 38 48 8b 94  ....H.R.H.T$8H..
        0x0180 24 88 00 00 00 48 8b 5a 10 48 89 5c 24 30 48 8b  $....H.Z.H.\\$0H.
        0x0190 4c 24 28 48 8b 44 24 38 e8 00 00 00 00 88 44 24  L$(H.D$8......D$
        0x01a0 1f 84 c0 75 05 e9 9a 00 00 00 eb 00 48 8b 94 24  ...u........H..$
        0x01b0 80 00 00 00 48 8b 52 28 48 89 54 24 28 48 8b 94  ....H.R(H.T$(H..
        0x01c0 24 80 00 00 00 48 8b 52 20 48 89 54 24 68 48 8b  $....H.R H.T$hH.
        0x01d0 94 24 88 00 00 00 48 8b 5a 20 48 89 5c 24 60 48  .$....H.Z H.\\$`H
        0x01e0 8b 4c 24 28 48 8b 44 24 68 e8 00 00 00 00 88 44  .L$(H.D$h......D
        0x01f0 24 1f 84 c0 75 02 eb 4a eb 00 48 8b 94 24 80 00  $...u..J..H..$..
        0x0200 00 00 48 8b 52 38 48 89 54 24 28 48 8b 94 24 80  ..H.R8H.T$(H..$.
        0x0210 00 00 00 48 8b 52 30 48 89 54 24 58 48 8b 94 24  ...H.R0H.T$XH..$
        0x0220 88 00 00 00 48 8b 5a 30 48 89 5c 24 50 48 8b 4c  ....H.Z0H.\\$PH.L
        0x0230 24 28 48 8b 44 24 58 e8 00 00 00 00 88 44 24 1e  $(H.D$X......D$.
        0x0240 eb 17 eb 0e eb 0c eb 0a eb 08 eb 06 eb 04 eb 02  ................
        0x0250 eb 00 c6 44 24 1e 00 eb 00 0f b6 44 24 1e 48 8b  ...D$......D$.H.
        0x0260 6c 24 70 48 83 c4 78 c3 48 89 44 24 08 48 89 5c  l$pH..x.H.D$.H.\\
        0x0270 24 10 e8 00 00 00 00 48 8b 44 24 08 48 8b 5c 24  $......H.D$.H.\\$
        0x0280 10 e9 7a fd ff ff                                ..z...
        rel 328+4 t=7 runtime.memequal+0
        rel 409+4 t=7 runtime.memequal+0
        rel 490+4 t=7 runtime.memequal+0
        rel 568+4 t=7 runtime.memequal+0
        rel 627+4 t=7 runtime.morestack_noctxt+0
go.cuinfo.packagename. SDWARFCUINFO dupok size=0
        0x0000 6d 61 69 6e                                      main
""..inittask SNOPTRDATA size=32
        0x0000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0010 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        rel 24+8 t=1 "".init+0
go.string."project_id" SRODATA dupok size=10
        0x0000 70 72 6f 6a 65 63 74 5f 69 64                    project_id
go.string."project_name" SRODATA dupok size=12
        0x0000 70 72 6f 6a 65 63 74 5f 6e 61 6d 65              project_name
go.string."project_desc" SRODATA dupok size=12
        0x0000 70 72 6f 6a 65 63 74 5f 64 65 73 63              project_desc
go.string."project_status" SRODATA dupok size=14
        0x0000 70 72 6f 6a 65 63 74 5f 73 74 61 74 75 73        project_status
"".projectMap SBSS size=8
type..eqfunc."".Project SRODATA dupok size=8
        0x0000 00 00 00 00 00 00 00 00                          ........
        rel 0+8 t=1 type..eq."".Project+0
runtime.memequal64·f SRODATA dupok size=8
        0x0000 00 00 00 00 00 00 00 00                          ........
        rel 0+8 t=1 runtime.memequal64+0
runtime.gcbits.01 SRODATA dupok size=1
        0x0000 01                                               .
type..namedata.*main.Project. SRODATA dupok size=15
        0x0000 01 0d 2a 6d 61 69 6e 2e 50 72 6f 6a 65 63 74     ..*main.Project
type.*"".Project SRODATA dupok size=56
        0x0000 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00  ................
        0x0010 a2 4a a9 ed 08 08 08 36 00 00 00 00 00 00 00 00  .J.....6........
        0x0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0030 00 00 00 00 00 00 00 00                          ........
        rel 24+8 t=1 runtime.memequal64·f+0
        rel 32+8 t=1 runtime.gcbits.01+0
        rel 40+4 t=5 type..namedata.*main.Project.+0
        rel 48+8 t=1 type."".Project+0
runtime.gcbits.55 SRODATA dupok size=1
        0x0000 55                                               U
type..namedata.ID.json:"id" SRODATA dupok size=14
        0x0000 03 02 49 44 09 6a 73 6f 6e 3a 22 69 64 22        ..ID.json:"id"
type..namedata.Name.json:"name" SRODATA dupok size=18
        0x0000 03 04 4e 61 6d 65 0b 6a 73 6f 6e 3a 22 6e 61 6d  ..Name.json:"nam
        0x0010 65 22                                            e"
type..namedata.Desc.json:"desc" SRODATA dupok size=18
        0x0000 03 04 44 65 73 63 0b 6a 73 6f 6e 3a 22 64 65 73  ..Desc.json:"des
        0x0010 63 22                                            c"
type..namedata.Status.json:"status" SRODATA dupok size=22
        0x0000 03 06 53 74 61 74 75 73 0d 6a 73 6f 6e 3a 22 73  ..Status.json:"s
        0x0010 74 61 74 75 73 22                                tatus"
type..namedata.IsDeleted.json:"is_deleted" SRODATA dupok size=29
        0x0000 03 09 49 73 44 65 6c 65 74 65 64 11 6a 73 6f 6e  ..IsDeleted.json
        0x0010 3a 22 69 73 5f 64 65 6c 65 74 65 64 22           :"is_deleted"
type."".Project SRODATA dupok size=216
        0x0000 48 00 00 00 00 00 00 00 38 00 00 00 00 00 00 00  H.......8.......
        0x0010 4b 1f 43 c9 07 08 08 19 00 00 00 00 00 00 00 00  K.C.............
        0x0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0040 05 00 00 00 00 00 00 00 05 00 00 00 00 00 00 00  ................
        0x0050 00 00 00 00 00 00 00 00 88 00 00 00 00 00 00 00  ................
        0x0060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0080 00 00 00 00 00 00 00 00 20 00 00 00 00 00 00 00  ........ .......
        0x0090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x00a0 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  @...............
        0x00b0 00 00 00 00 00 00 00 00 60 00 00 00 00 00 00 00  ........`.......
        0x00c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x00d0 80 00 00 00 00 00 00 00                          ........
        rel 24+8 t=1 type..eqfunc."".Project+0
        rel 32+8 t=1 runtime.gcbits.55+0
        rel 40+4 t=5 type..namedata.*main.Project.+0
        rel 44+4 t=5 type.*"".Project+0
        rel 56+8 t=1 type."".Project+96
        rel 80+4 t=5 type..importpath."".+0
        rel 96+8 t=1 type..namedata.ID.json:"id"+0
        rel 104+8 t=1 type.string+0
        rel 120+8 t=1 type..namedata.Name.json:"name"+0
        rel 128+8 t=1 type.string+0
        rel 144+8 t=1 type..namedata.Desc.json:"desc"+0
        rel 152+8 t=1 type.string+0
        rel 168+8 t=1 type..namedata.Status.json:"status"+0
        rel 176+8 t=1 type.string+0
        rel 192+8 t=1 type..namedata.IsDeleted.json:"is_deleted"+0
        rel 200+8 t=1 type.uint8+0
type..namedata.*[]uint8- SRODATA dupok size=10
        0x0000 00 08 2a 5b 5d 75 69 6e 74 38                    ..*[]uint8
type.*[]uint8 SRODATA dupok size=56
        0x0000 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00  ................
        0x0010 a5 8e d0 69 08 08 08 36 00 00 00 00 00 00 00 00  ...i...6........
        0x0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0030 00 00 00 00 00 00 00 00                          ........
        rel 24+8 t=1 runtime.memequal64·f+0
        rel 32+8 t=1 runtime.gcbits.01+0
        rel 40+4 t=5 type..namedata.*[]uint8-+0
        rel 48+8 t=1 type.[]uint8+0
type.[]uint8 SRODATA dupok size=56
        0x0000 18 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00  ................
        0x0010 df 7e 2e 38 02 08 08 17 00 00 00 00 00 00 00 00  .~.8............
        0x0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0030 00 00 00 00 00 00 00 00                          ........
        rel 32+8 t=1 runtime.gcbits.01+0
        rel 40+4 t=5 type..namedata.*[]uint8-+0
        rel 44+4 t=-32763 type.*[]uint8+0
        rel 48+8 t=1 type.uint8+0
type..namedata.*[8]uint8- SRODATA dupok size=11
        0x0000 00 09 2a 5b 38 5d 75 69 6e 74 38                 ..*[8]uint8
type.*[8]uint8 SRODATA dupok size=56
        0x0000 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00  ................
        0x0010 a9 89 a5 7a 08 08 08 36 00 00 00 00 00 00 00 00  ...z...6........
        0x0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0030 00 00 00 00 00 00 00 00                          ........
        rel 24+8 t=1 runtime.memequal64·f+0
        rel 32+8 t=1 runtime.gcbits.01+0
        rel 40+4 t=5 type..namedata.*[8]uint8-+0
        rel 48+8 t=1 type.[8]uint8+0
runtime.gcbits. SRODATA dupok size=0
type.[8]uint8 SRODATA dupok size=72
        0x0000 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0010 3e f9 30 b4 0a 01 01 11 00 00 00 00 00 00 00 00  >.0.............
        0x0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0040 08 00 00 00 00 00 00 00                          ........
        rel 24+8 t=1 runtime.memequal64·f+0
        rel 32+8 t=1 runtime.gcbits.+0
        rel 40+4 t=5 type..namedata.*[8]uint8-+0
        rel 44+4 t=-32763 type.*[8]uint8+0
        rel 48+8 t=1 type.uint8+0
        rel 56+8 t=1 type.[]uint8+0
type..namedata.*[]string- SRODATA dupok size=11
        0x0000 00 09 2a 5b 5d 73 74 72 69 6e 67                 ..*[]string
type.*[]string SRODATA dupok size=56
        0x0000 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00  ................
        0x0010 92 22 76 84 08 08 08 36 00 00 00 00 00 00 00 00  ."v....6........
        0x0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0030 00 00 00 00 00 00 00 00                          ........
        rel 24+8 t=1 runtime.memequal64·f+0
        rel 32+8 t=1 runtime.gcbits.01+0
        rel 40+4 t=5 type..namedata.*[]string-+0
        rel 48+8 t=1 type.[]string+0
type.[]string SRODATA dupok size=56
        0x0000 18 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00  ................
        0x0010 d3 a8 f3 0a 02 08 08 17 00 00 00 00 00 00 00 00  ................
        0x0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0030 00 00 00 00 00 00 00 00                          ........
        rel 32+8 t=1 runtime.gcbits.01+0
        rel 40+4 t=5 type..namedata.*[]string-+0
        rel 44+4 t=-32763 type.*[]string+0
        rel 48+8 t=1 type.string+0
type..namedata.*[8]string- SRODATA dupok size=12
        0x0000 00 0a 2a 5b 38 5d 73 74 72 69 6e 67              ..*[8]string
type.*[8]string SRODATA dupok size=56
        0x0000 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00  ................
        0x0010 ad 94 14 6f 08 08 08 36 00 00 00 00 00 00 00 00  ...o...6........
        0x0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0030 00 00 00 00 00 00 00 00                          ........
        rel 24+8 t=1 runtime.memequal64·f+0
        rel 32+8 t=1 runtime.gcbits.01+0
        rel 40+4 t=5 type..namedata.*[8]string-+0
        rel 48+8 t=1 type.noalg.[8]string+0
runtime.gcbits.5555 SRODATA dupok size=2
        0x0000 55 55                                            UU
type.noalg.[8]string SRODATA dupok size=72
        0x0000 80 00 00 00 00 00 00 00 78 00 00 00 00 00 00 00  ........x.......
        0x0010 55 53 8c 3e 02 08 08 11 00 00 00 00 00 00 00 00  US.>............
        0x0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0040 08 00 00 00 00 00 00 00                          ........
        rel 32+8 t=1 runtime.gcbits.5555+0
        rel 40+4 t=5 type..namedata.*[8]string-+0
        rel 44+4 t=-32763 type.*[8]string+0
        rel 48+8 t=1 type.string+0
        rel 56+8 t=1 type.[]string+0
type..namedata.*[]*main.Project- SRODATA dupok size=18
        0x0000 00 10 2a 5b 5d 2a 6d 61 69 6e 2e 50 72 6f 6a 65  ..*[]*main.Proje
        0x0010 63 74                                            ct
type.*[]*"".Project SRODATA dupok size=56
        0x0000 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00  ................
        0x0010 b9 ed 8e 37 08 08 08 36 00 00 00 00 00 00 00 00  ...7...6........
        0x0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0030 00 00 00 00 00 00 00 00                          ........
        rel 24+8 t=1 runtime.memequal64·f+0
        rel 32+8 t=1 runtime.gcbits.01+0
        rel 40+4 t=5 type..namedata.*[]*main.Project-+0
        rel 48+8 t=1 type.[]*"".Project+0
type.[]*"".Project SRODATA dupok size=56
        0x0000 18 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00  ................
        0x0010 6c cd 73 7d 02 08 08 17 00 00 00 00 00 00 00 00  l.s............
        0x0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0030 00 00 00 00 00 00 00 00                          ........
        rel 32+8 t=1 runtime.gcbits.01+0
        rel 40+4 t=5 type..namedata.*[]*main.Project-+0
        rel 44+4 t=-32763 type.*[]*"".Project+0
        rel 48+8 t=1 type.*"".Project+0
type..namedata.*[8]*main.Project- SRODATA dupok size=19
        0x0000 00 11 2a 5b 38 5d 2a 6d 61 69 6e 2e 50 72 6f 6a  ..*[8]*main.Proj
        0x0010 65 63 74                                         ect
type.*[8]*"".Project SRODATA dupok size=56
        0x0000 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00  ................
        0x0010 a3 f6 34 14 08 08 08 36 00 00 00 00 00 00 00 00  ..4....6........
        0x0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0030 00 00 00 00 00 00 00 00                          ........
        rel 24+8 t=1 runtime.memequal64·f+0
        rel 32+8 t=1 runtime.gcbits.01+0
        rel 40+4 t=5 type..namedata.*[8]*main.Project-+0
        rel 48+8 t=1 type.noalg.[8]*"".Project+0
runtime.gcbits.ff SRODATA dupok size=1
        0x0000 ff                                               .
type.noalg.[8]*"".Project SRODATA dupok size=72
        0x0000 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00  @.......@.......
        0x0010 8d b9 07 e4 02 08 08 11 00 00 00 00 00 00 00 00  ................
        0x0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0040 08 00 00 00 00 00 00 00                          ........
        rel 32+8 t=1 runtime.gcbits.ff+0
        rel 40+4 t=5 type..namedata.*[8]*main.Project-+0
        rel 44+4 t=-32763 type.*[8]*"".Project+0
        rel 48+8 t=1 type.*"".Project+0
        rel 56+8 t=1 type.[]*"".Project+0
type..namedata.*map.bucket[string]*main.Project- SRODATA dupok size=34
        0x0000 00 20 2a 6d 61 70 2e 62 75 63 6b 65 74 5b 73 74  . *map.bucket[st
        0x0010 72 69 6e 67 5d 2a 6d 61 69 6e 2e 50 72 6f 6a 65  ring]*main.Proje
        0x0020 63 74                                            ct
type.*map.bucket[string]*"".Project SRODATA dupok size=56
        0x0000 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00  ................
        0x0010 c5 47 3a 04 08 08 08 36 00 00 00 00 00 00 00 00  .G:....6........
        0x0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0030 00 00 00 00 00 00 00 00                          ........
        rel 24+8 t=1 runtime.memequal64·f+0
        rel 32+8 t=1 runtime.gcbits.01+0
        rel 40+4 t=5 type..namedata.*map.bucket[string]*main.Project-+0
        rel 48+8 t=1 type.noalg.map.bucket[string]*"".Project+0
runtime.gcbits.aaaafe03 SRODATA dupok size=4
        0x0000 aa aa fe 03                                      ....
type..importpath.. SRODATA dupok size=2
        0x0000 00 00                                            ..
type..namedata.topbits- SRODATA dupok size=9
        0x0000 00 07 74 6f 70 62 69 74 73                       ..topbits
type..namedata.keys- SRODATA dupok size=6
        0x0000 00 04 6b 65 79 73                                ..keys
type..namedata.elems- SRODATA dupok size=7
        0x0000 00 05 65 6c 65 6d 73                             ..elems
type..namedata.overflow- SRODATA dupok size=10
        0x0000 00 08 6f 76 65 72 66 6c 6f 77                    ..overflow
type.noalg.map.bucket[string]*"".Project SRODATA dupok size=176
        0x0000 d0 00 00 00 00 00 00 00 d0 00 00 00 00 00 00 00  ................
        0x0010 51 00 2c 6f 02 08 08 19 00 00 00 00 00 00 00 00  Q.,o............
        0x0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0040 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00  ................
        0x0050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0070 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00  ................
        0x0080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0090 10 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x00a0 00 00 00 00 00 00 00 00 90 01 00 00 00 00 00 00  ................
        rel 32+8 t=1 runtime.gcbits.aaaafe03+0
        rel 40+4 t=5 type..namedata.*map.bucket[string]*main.Project-+0
        rel 44+4 t=-32763 type.*map.bucket[string]*"".Project+0
        rel 48+8 t=1 type..importpath..+0
        rel 56+8 t=1 type.noalg.map.bucket[string]*"".Project+80
        rel 80+8 t=1 type..namedata.topbits-+0
        rel 88+8 t=1 type.[8]uint8+0
        rel 104+8 t=1 type..namedata.keys-+0
        rel 112+8 t=1 type.noalg.[8]string+0
        rel 128+8 t=1 type..namedata.elems-+0
        rel 136+8 t=1 type.noalg.[8]*"".Project+0
        rel 152+8 t=1 type..namedata.overflow-+0
        rel 160+8 t=1 type.unsafe.Pointer+0
runtime.strhash·f SRODATA dupok size=8
        0x0000 00 00 00 00 00 00 00 00                          ........
        rel 0+8 t=1 runtime.strhash+0
type..namedata.*map[string]*main.Project- SRODATA dupok size=27
        0x0000 00 19 2a 6d 61 70 5b 73 74 72 69 6e 67 5d 2a 6d  ..*map[string]*m
        0x0010 61 69 6e 2e 50 72 6f 6a 65 63 74                 ain.Project
type.*map[string]*"".Project SRODATA dupok size=56
        0x0000 08 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00  ................
        0x0010 44 41 94 e3 08 08 08 36 00 00 00 00 00 00 00 00  DA.....6........
        0x0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        0x0000 00 08 08 08 ff                                   .....

下面主要看下21行对应的汇编:

        0x0128 00296 (main\\main.go:21)  MOVQ    "".item+48(SP), DX
        0x012d 00301 (main\\main.go:21)  TESTB   AL, (DX) //TESTB AL, (DX) 逻辑与指令,这里是用做 nil check,如果加载DX失败会触发段错误信号SIGSEGV,触发Go Runtime抛出Panic。选择TESTB仅仅是因为指令短小。
        0x012f 00303 (main\\main.go:21)  MOVQ    (DX), CX 
        0x0132 00306 (main\\main.go:21)  MOVQ    8(DX), DI
        0x0136 00310 (main\\main.go:21)  MOVQ    CX, ""..autotmp_3+64(SP)
        0x013b 00315 (main\\main.go:21)  MOVQ    DI, ""..autotmp_3+72(SP)
        0x0140 00320 (main\\main.go:21)  MOVQ    "".items+40(SP), BX
        0x0145 00325 (main\\main.go:21)  LEAQ    type.map[string]*"".Project(SB), AX
        0x014c 00332 (main\\main.go:21)  PCDATA  $1, $2 //FUNCDATA和PCDATA是编译器产生的,用于保存一些给垃圾收集的信息。
        0x014c 00332 (main\\main.go:21)  CALL    runtime.mapassign_faststr(SB) // https://github.com/golang/go/blob/29bbca5c2c1ad41b2a9747890d183b6dd3a4ace4/src/runtime/map_faststr.go
        0x0151 00337 (main\\main.go:21)  MOVQ    AX, ""..autotmp_4+56(SP)
        0x0156 00342 (main\\main.go:21)  TESTB   AL, (AX)
        0x0158 00344 (main\\main.go:21)  MOVQ    "".item+48(SP), DX
        0x015d 00349 (main\\main.go:21)  PCDATA  $0, $-2 //FUNCDATA和PCDATA是编译器产生的,用于保存一些给垃圾收集的信息。
        0x015d 00349 (main\\main.go:21)  CMPL    runtime.writeBarrier(SB), $0 // https://github.com/golang/go/blob/1243ec9c177007879958443262fe4d25099c5ede/src/cmd/compile/internal/ssa/writebarrier.go#L91:6
        0x0164 00356 (main\\main.go:21)  JEQ     360
        0x0166 00358 (main\\main.go:21)  JMP     365
        0x0168 00360 (main\\main.go:21)  MOVQ    DX, (AX)
        0x016b 00363 (main\\main.go:21)  JMP     375
        0x016d 00365 (main\\main.go:21)  MOVQ    AX, DI
        0x0170 00368 (main\\main.go:21)  CALL    runtime.gcWriteBarrierDX(SB) // https://github.com/golang/go/blob/2ebe77a2fda1ee9ff6fd9a3e08933ad1ebaea039/src/runtime/stubs_amd64.go#L11
        0x0175 00373 (main\\main.go:21)  JMP     375

基础知识补充:

MOVQ

  • movb(8位)、movw(16位)、movl(32位)、movq(64位)

  • 寄存器寻址:

movl %eax, %edx
eax -> edx

https://blog.csdn.net/luoyhang003/article/details/46786591/

TESTB

TEST指令的行为与AND指令一样,除了不改变目的寄存器的值。例如,testq %rax, %rax 用来检查 %rax 是负数、零、还是正数。

LEAQ vs MOVQ

https://stackoverflow.com/questions/1699748/what-is-the-difference-between-mov-and-lea

PCDATA

https://www.cnblogs.com/binHome/p/13034103.html

CMPL

CMPL %eax,%ebx
==> 
[ebx]-[eax],就是把第二个数减去第一个数

JMP

无条件转移指令
JMP 389无条件转至0x0185地址处(十进制389转换成十六进制0x0185)

CALL

调用函数
CALL runtime.printnl(SB)表示通过printnl函数的内存地址发起调用

伪计数器

FP: Frame pointer: arguments and locals.(指向当前栈帧)
PC: Program counter: jumps and branches.(指向指令地址)
SB: Static base pointer: global symbols.(指向全局符号表)
SP: Stack pointer: top of stack.(指向当前栈顶部)
注意: 栈是向下整长 golang的汇编是调用者维护参数返回值跟返回地址。所以FP的值小于参数跟返回值

拓展阅读:https://github.com/cch123/golang-notes/blob/master/assembly.md

本机环境

x86-64( 又称x64,即英文词64-bit extended,64位拓展 的简写)是x86架构的64位拓展,向后兼容于16位及32位的x86架构。x64于1999年由AMD设计,AMD首次公开64位集以扩展给x86,称为“AMD64”。

编译命令详解

PS D:\\Code\\Golang\\github\\jiankunking\\cow-test> go tool compile -help
usage: compile [options] file.go...
  -% int
        debug non-static initializers
  -+    compiling runtime
  -B    disable bounds checking
  -C    disable printing of columns in error messages
  -D path
        set relative path for local imports
  -E    debug symbol export
  -G    accept generic code (default 3)
  -I directory
        add directory to import search path
  -K    debug missing line numbers
  -L    show full file names in error messages
  -N    disable optimizations
  -S    print assembly listing
  -V    print version and exit
  -W    debug parse tree after type checking
  -asan
        build code compatible with C/C++ address sanitizer
  -asmhdr file
        write assembly header to file
  -bench file
        append benchmark times to file
  -blockprofile file
        write block profile to file
  -buildid id
        record id as the build id in the export metadata
  -c int
        concurrency during compilation (1 means no concurrency) (default 1)
  -clobberdead
        clobber dead stack slots (for debugging)
  -clobberdeadreg
        clobber dead registers (for debugging)
  -complete
        compiling complete package (no C or assembly)
  -cpuprofile file
        write cpu profile to file
  -d value
        enable debugging settings; try -d help
  -dwarf
        generate DWARF symbols (default true)
  -dwarfbasentries
        use base address selection entries in DWARF (default true)
  -dwarflocationlists
        add location lists to DWARF in optimized mode (default true)
  -dynlink
        support references to Go symbols defined in other shared libraries
  -e    no limit on number of errors reported
  -embedcfg file
        read go:embed configuration from file
  -gendwarfinl int
        generate DWARF inline info records (default 2)
  -goversion string
        required version of the runtime
  -h    halt on error
  -importcfg file
        read import configuration from file
  -importmap definition
        add definition of the form source=actual to import map
  -installsuffix suffix
        set pkg directory suffix
  -j    debug runtime-initialized variables
  -json string
        version,file for JSON compiler/optimizer detail output
  -l    disable inlining
  -lang string
        Go language version source code expects
  -linkobj file
        write linker-specific object to file
  -linkshared
        generate code that will be linked against Go shared libraries
  -live
        debug liveness analysis
  -m    print optimization decisions
  -memprofile file
        write memory profile to file
  -memprofilerate rate
        set runtime.MemProfileRate to rate
  -msan
        build code compatible with C/C++ memory sanitizer
  -mutexprofile file
        write mutex profile to file
  -nolocalimports
        reject local (relative) imports
  -o file
        write output to file
  -p path
        set expected package import path
  -pack
        write to file.a instead of file.o
  -r    debug generated wrappers
  -race
        enable race detector
  -shared
        generate code that can be linked into a shared library
  -smallframes
        reduce the size limit for stack allocated objects
  -spectre list
        enable spectre mitigations in list (all, index, ret)
  -std
        compiling standard library
  -symabis file
        read symbol ABIs from file
  -t    enable tracing for debugging the compiler
  -traceprofile file
        write an execution trace to file
  -trimpath prefix
        remove prefix from recorded source file paths
  -v    increase debug verbosity
  -w    debug type checking
  -wb
        enable write barrier (default true)

以上是关于Golang写时复制是否是原子性的?的主要内容,如果未能解决你的问题,请参考以下文章

Golang写时复制是否是原子性的?

golang 原子操作函数

创建一个对象和i++是否原子性的理解

写时复制会防止阵列上的数据重复吗?

写时复制会防止阵列上的数据重复吗?

为什么Redis的操作是原子性的,怎么保证原子性的?