mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-09-06 09:06:44 +00:00
![Paddy](/assets/img/avatar_default.png)
Switch to using Go modules. This migrates our vendor.json to use Go 1.11's modules system, and replaces the vendor folder with the output of go mod vendor. The vendored code should remain basically the same; I believe some tree shaking of packages and support scripts/licenses/READMEs/etc. happened. This also fixes Travis and our Makefile to no longer use govendor.
24 lines
689 B
Go
24 lines
689 B
Go
// Copyright 2017, 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.md file.
|
|
|
|
// +build !purego,!appengine,!js
|
|
|
|
package cmp
|
|
|
|
import (
|
|
"reflect"
|
|
"unsafe"
|
|
)
|
|
|
|
const supportAllowUnexported = true
|
|
|
|
// unsafeRetrieveField uses unsafe to forcibly retrieve any field from a struct
|
|
// such that the value has read-write permissions.
|
|
//
|
|
// The parent struct, v, must be addressable, while f must be a StructField
|
|
// describing the field to retrieve.
|
|
func unsafeRetrieveField(v reflect.Value, f reflect.StructField) reflect.Value {
|
|
return reflect.NewAt(f.Type, unsafe.Pointer(v.UnsafeAddr()+f.Offset)).Elem()
|
|
}
|