1
0
mirror of https://github.com/golang/go synced 2024-11-24 02:40:17 -07:00
go/test/unsafereject2.go

16 lines
394 B
Go
Raw Normal View History

// errorcheck -u -+
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Check that we cannot import the "unsafe" package when -u is supplied.
package a
import "unsafe" // ERROR "import package unsafe"
func Float32bits(f float32) uint32 {
return *(*uint32)(unsafe.Pointer(&f))
}