gitee.com/mirrors_u-root/u-root@v7.0.0+incompatible/pkg/uroot/test/bar/bar.go (about)

     1  // Copyright 2020 the u-root 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 bar
     6  
     7  import "fmt"
     8  
     9  type Interface interface {
    10  	UsedInterfaceMethod()
    11  	UnusedInterfaceMethod()
    12  }
    13  
    14  type Bar struct{}
    15  
    16  func (Bar) UsedInterfaceMethod() {
    17  	fmt.Println("one")
    18  }
    19  
    20  // This method is unused but cannot be eliminated yet.
    21  // https://github.com/golang/go/issues/38685
    22  func (Bar) UnusedInterfaceMethod() {
    23  	fmt.Println("two")
    24  }
    25  
    26  // This method is unused and should be eliminated.
    27  func (Bar) UnusedNonInterfaceMethod() {
    28  	fmt.Println("three")
    29  }