mirror of
https://github.com/golang/go
synced 2024-11-18 04:34:52 -07:00
6e5ccce87f
Fixes these warnings from go vet: buildid_linux.go:25: no formatting directive in Fatalf call callback.go:180: arg pc[i] for printf verb %p of wrong type: uintptr env.go:34: possible misuse of unsafe.Pointer issue7665.go:22: possible misuse of unsafe.Pointer Change-Id: I83811b9c10c617139713a626b4a34ab05564d4fe Reviewed-on: https://go-review.googlesource.com/15802 Reviewed-by: David Crawshaw <crawshaw@golang.org>
26 lines
524 B
Go
26 lines
524 B
Go
// Copyright 2013 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.
|
|
|
|
package cgotest
|
|
|
|
import (
|
|
"testing"
|
|
"unsafe"
|
|
)
|
|
|
|
// extern void f7665(void);
|
|
import "C"
|
|
|
|
//export f7665
|
|
func f7665() {}
|
|
|
|
var bad7665 unsafe.Pointer = C.f7665
|
|
var good7665 uintptr = uintptr(C.f7665)
|
|
|
|
func test7665(t *testing.T) {
|
|
if bad7665 == nil || uintptr(bad7665) != good7665 {
|
|
t.Errorf("ptrs = %p, %#x, want same non-nil pointer", bad7665, good7665)
|
|
}
|
|
}
|