unmarshal.go 406 B

123456789101112131415161718
  1. // Copyright 2018 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // This file contains tests for the unmarshal checker.
  5. package unmarshal
  6. import "encoding/json"
  7. func _() {
  8. type t struct {
  9. a int
  10. }
  11. var v t
  12. json.Unmarshal([]byte{}, v) // ERROR "call of Unmarshal passes non-pointer as second argument"
  13. }