github.com/chenfeining/golangci-lint@v1.0.2-0.20230730162517-14c6c67868df/test/testdata/gosmopolitan_escape_hatches.go (about)

     1  //golangcitest:args -Egosmopolitan
     2  //golangcitest:config_path testdata/configs/gosmopolitan_escape_hatches.yml
     3  package testdata
     4  
     5  import (
     6  	myAlias "fmt"
     7  )
     8  
     9  type A string
    10  type B = string
    11  type C struct {
    12  	foo string
    13  	Bar string
    14  }
    15  
    16  func D(fmt string) string {
    17  	myAlias.Println(fmt, "测试")
    18  	return myAlias.Sprintf("%s 测试", fmt) // want `string literal contains rune in Han script`
    19  }
    20  
    21  type X struct {
    22  	baz string
    23  }
    24  
    25  func main() {
    26  	_ = A("测试")
    27  	_ = string(A(string("测试")))
    28  	_ = B("测试")
    29  	_ = C{
    30  		foo: "测试",
    31  		Bar: "测试",
    32  	}
    33  	_ = D("测试")
    34  
    35  	_ = &X{
    36  		baz: "测试", // want `string literal contains rune in Han script`
    37  	}
    38  }