• Kirill Smelkov's avatar
    tracing/runtime: Replace any -> interface{} · 4def45d2
    Kirill Smelkov authored
    Else if a project, that uses go123, is compiled by go1.18 or go1.19,
    then go complains that go123 uses `any`, but the language, that go123
    requires in it's go.mod, is only 1.14:
    
        kirr@deca:~/src/wendelin/wendelin.core/wcfs$ go build
        # lab.nexedi.com/kirr/go123/tracing/internal/xruntime
        /home/kirr/go/pkg/mod/lab.nexedi.com/kirr/go123@v0.0.0-20221005052354-179529a7/tracing/internal/xruntime/zruntime_g_go1.19.go:114:12: predeclared any requires go1.18 or later (-lang was set to go1.14; check go.mod)
        /home/kirr/go/pkg/mod/lab.nexedi.com/kirr/go123@v0.0.0-20221005052354-179529a7/tracing/internal/xruntime/zruntime_g_go1.19.go:184:14: predeclared any requires go1.18 or later (-lang was set to go1.14; check go.mod)
        /home/kirr/go/pkg/mod/lab.nexedi.com/kirr/go123@v0.0.0-20221005052354-179529a7/tracing/internal/xruntime/zruntime_g_go1.19.go:185:9: predeclared any requires go1.18 or later (-lang was set to go1.14; check go.mod)
    
    -> Fix that by expanding `any` to what it is aliased to:
    
        $ go doc builtin.any
        package builtin // import "builtin"
    
        type any = interface{}
            any is an alias for interface{} and is equivalent to interface{} in all
            ways.
    
    Go123 wants to support older systems, and so we do not want to bump
    go123's required language, at least for now.
    
    For the reference: they started to use `any` somewhere in go1.18 (see
    070bfdbb "tracing/runtime: Refresh for Go1.18").
    4def45d2
zruntime_g_go1.14.go 7.75 KB