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

     1  // Copyright 2024 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 rewrites is for testing that the syntax-rewriting code in the
     8  // analysis library handles various types of statements correctly.
     9  package rewrites
    10  
    11  import "sort"
    12  
    13  func Foo() {
    14  	var err error
    15  	err.Error()
    16  	s := sort.IntSlice(nil)
    17  	goto foo
    18  foo:
    19  	sort.Sort(s)
    20  	if sort.Sort(s); true {
    21  	}
    22  	switch sort.Sort(s); int(0) {
    23  	}
    24  	var x any
    25  	switch sort.Sort(s); x.(type) {
    26  	}
    27  	for sort.Sort(s); false; sort.Sort(s) {
    28  	}
    29  	sort.Sort(nil)
    30  }