Source file test/fixedbugs/issue75365.go

     1  // run
     2  
     3  // Copyright 2026 The Go Authors. All rights reserved.
     4  // Use of this source code is governed by a BSD-style
     5  // license that can be found in the LICENSE file.
     6  
     7  package main
     8  
     9  import (
    10  	"fmt"
    11  	"unsafe"
    12  )
    13  
    14  type S struct {
    15  	p *byte
    16  	a string
    17  	b string
    18  	c int64
    19  	d int64
    20  }
    21  
    22  func main() {
    23  	s := &S{p: nil, a: "foo", b: "foo", c: 0, d: 0}
    24  	s.a = ""
    25  	s.b = "bar"
    26  	s.c = 33
    27  
    28  	z := (*[2]uintptr)(unsafe.Pointer(&s.a))
    29  	fmt.Printf("%x %x\n", z[0], z[1])
    30  }
    31  

View as plain text