Source file test/fixedbugs/issue19548.dir/a.go

     1  // Copyright 2016 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  package a
     6  
     7  type Mode uint
     8  
     9  func (m Mode) String() string { return "mode string" }
    10  func (m *Mode) Addr() *Mode   { return m }
    11  
    12  type Stringer interface {
    13  	String() string
    14  }
    15  
    16  var global Stringer
    17  var m Mode
    18  
    19  func init() {
    20  	// force compilation of the (*Mode).String() wrapper
    21  	global = &m
    22  }
    23  
    24  func String() string {
    25  	return global.String() + Mode(0).String()
    26  }
    27  

View as plain text