github.com/google/capslock@v0.2.3-0.20240517042941-dac19fc347c0/testpkgs/importname/importname.go (about)

     1  // Copyright 2023 Google LLC
     2  //
     3  // Use of this source code is governed by a BSD-style
     4  // license that can be found in the LICENSE file or at
     5  // https://developers.google.com/open-source/licenses/bsd
     6  
     7  // Package importname is used for testing whether we analyze the names of imports correctly.
     8  package importname
     9  
    10  import (
    11  	"github.com/google/capslock/testpkgs/importname/sort"
    12  )
    13  
    14  type foo struct{}
    15  
    16  func (m *foo) Len() int           { return 1 }
    17  func (m *foo) Less(i, j int) bool { return false }
    18  func (m *foo) Swap(i, j int)      {}
    19  
    20  // CallTheWrongSort calls a function that is written sort.Sort, but
    21  // refers to a function in a library that isn't the standard library "sort".
    22  func CallTheWrongSort() {
    23  	sort.Sort(new(foo))
    24  }