• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2020 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
5// This example uses reflect.Value.Call, but not
6// reflect.{Value,Type}.Method. This should not
7// need to bring all methods live.
8
9package main
10
11import "reflect"
12
13func f() { println("call") }
14
15type T int
16
17func (T) M() {}
18
19func main() {
20	v := reflect.ValueOf(f)
21	v.Call(nil)
22	i := interface{}(T(1))
23	println(i)
24}
25