|
Packit |
63bb0d |
// Copyright (c) 2015-2016 Dave Collins <dave@davec.name>
|
|
Packit |
63bb0d |
//
|
|
Packit |
63bb0d |
// Permission to use, copy, modify, and distribute this software for any
|
|
Packit |
63bb0d |
// purpose with or without fee is hereby granted, provided that the above
|
|
Packit |
63bb0d |
// copyright notice and this permission notice appear in all copies.
|
|
Packit |
63bb0d |
//
|
|
Packit |
63bb0d |
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
Packit |
63bb0d |
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
Packit |
63bb0d |
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
Packit |
63bb0d |
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
Packit |
63bb0d |
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
Packit |
63bb0d |
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
Packit |
63bb0d |
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
Packit |
63bb0d |
|
|
Packit |
63bb0d |
// NOTE: Due to the following build constraints, this file will only be compiled
|
|
Packit |
63bb0d |
// when the code is running on Google App Engine, compiled by GopherJS, or
|
|
Packit |
63bb0d |
// "-tags safe" is added to the go build command line. The "disableunsafe"
|
|
Packit |
63bb0d |
// tag is deprecated and thus should not be used.
|
|
Packit Service |
509fd4 |
// +build js appengine safe disableunsafe !go1.4
|
|
Packit |
63bb0d |
|
|
Packit |
63bb0d |
package spew
|
|
Packit |
63bb0d |
|
|
Packit |
63bb0d |
import "reflect"
|
|
Packit |
63bb0d |
|
|
Packit |
63bb0d |
const (
|
|
Packit |
63bb0d |
// UnsafeDisabled is a build-time constant which specifies whether or
|
|
Packit |
63bb0d |
// not access to the unsafe package is available.
|
|
Packit |
63bb0d |
UnsafeDisabled = true
|
|
Packit |
63bb0d |
)
|
|
Packit |
63bb0d |
|
|
Packit |
63bb0d |
// unsafeReflectValue typically converts the passed reflect.Value into a one
|
|
Packit |
63bb0d |
// that bypasses the typical safety restrictions preventing access to
|
|
Packit |
63bb0d |
// unaddressable and unexported data. However, doing this relies on access to
|
|
Packit |
63bb0d |
// the unsafe package. This is a stub version which simply returns the passed
|
|
Packit |
63bb0d |
// reflect.Value when the unsafe package is not available.
|
|
Packit |
63bb0d |
func unsafeReflectValue(v reflect.Value) reflect.Value {
|
|
Packit |
63bb0d |
return v
|
|
Packit |
63bb0d |
}
|