Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal code uses deprecated APIs #2480

Open
rogpeppe opened this issue Jul 11, 2023 · 1 comment
Open

internal code uses deprecated APIs #2480

rogpeppe opened this issue Jul 11, 2023 · 1 comment
Labels

Comments

@rogpeppe
Copy link
Member

What version of CUE are you using (cue version)?

commit 41b38fe201f40e13f0c23787a615e25f295ac609 (tip as of time of writing)

Does this issue reproduce with the latest stable release?

Yes

What did you do?

Look at the source.

What did you expect to see?

No unnecessary uses of APIs that have been publicly deprecated.

What did you see instead?

Many legacy uses of *cue.Instance and other deprecated functions and types from the cue package.

The project should lead by example and convert its code to use the supported API, both ensuring that the API is fit for purpose and enabling removal of the deprecated APIs in the future.

@rogpeppe
Copy link
Member Author

Here's an initial list of uses of deprecated APIs as reported by staticcheck:

cmd/cue/cmd/add.go:177:8: cue.Build is deprecated: use cuecontext.Context.BuildInstances. The use of Instance is being phased out.  (SA1019)
cmd/cue/cmd/add.go:255:23: internal.PackageInfo is deprecated: use GetPackageInfo  (SA1019)
cmd/cue/cmd/common.go:751:15: cue.Build is deprecated: use cuecontext.Context.BuildInstances. The use of Instance is being phased out.  (SA1019)
cmd/cue/cmd/common.go:806:10: cue.Merge is deprecated: do not use.  (SA1019)
cmd/cue/cmd/common.go:812:17: r.Build is deprecated: use Context.BuildInstance. The use of Instance is being phased out.  (SA1019)
cmd/cue/cmd/common.go:821:9: inst.Build is deprecated: use Context.Build  (SA1019)
cmd/cue/cmd/completion.go:58:14: cobra.ExactValidArgs is deprecated: use MatchAll(ExactArgs(n), OnlyValidArgs) instead  (SA1019)
cmd/cue/cmd/custom.go:45:14: obj.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
cmd/cue/cmd/custom.go:65:14: tools.Lookup is deprecated: use Value.LookupPath  (SA1019)
cmd/cue/cmd/custom.go:88:7: tools.Lookup is deprecated: use Value.LookupPath  (SA1019)
cmd/cue/cmd/custom.go:96:32: tools.Lookup is deprecated: use Value.LookupPath  (SA1019)
cmd/cue/cmd/custom.go:188:5: v.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
cmd/cue/cmd/custom.go:192:14: v.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
cmd/cue/cmd/custom.go:210:16: v.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
cmd/cue/cmd/custom.go:215:17: v.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
cmd/cue/cmd/get_go.go:304:9: types.NewSignature has been deprecated since Go 1.18: Use NewSignatureType instead which allows for type parameters.  (SA1019)
cmd/cue/cmd/get_go.go:580:20: internal.PackageInfo is deprecated: use GetPackageInfo  (SA1019)
cmd/cue/cmd/get_go.go:790:7: cv.AddComment is deprecated: use ast.AddComment  (SA1019)
cmd/cue/cmd/get_go.go:847:3: x.AddComment is deprecated: use ast.AddComment  (SA1019)
cmd/cue/cmd/orphans.go:169:14: internal.PackageInfo is deprecated: use GetPackageInfo  (SA1019)
cmd/cue/cmd/orphans.go:240:12: v.Elem is deprecated: use LookupPath in combination with "AnyString" or "AnyIndex".  (SA1019)
cue/ast/astutil/apply.go:314:14: node.Comments is deprecated: use ast.Comments  (SA1019)
cue/ast/astutil/apply.go:467:32: node.Comments is deprecated: use ast.Comments  (SA1019)
cue/ast/astutil/file_test.go:83:10: cue.Runtime is deprecated: use Context.  (SA1019)
cue/ast/astutil/file_test.go:85:17: r.CompileFile is deprecated: use BuildFile. The use of Instance is being phased out.  (SA1019)
cue/ast/astutil/resolve.go:311:18: ast.ParseIdent is deprecated: quoted identifiers are deprecated. Use aliases.  (SA1019)
cue/ast/astutil/resolve.go:423:18: ast.ParseIdent is deprecated: quoted identifiers are deprecated. Use aliases.  (SA1019)
cue/ast/astutil/resolve.go:428:17: ast.ParseIdent is deprecated: quoted identifiers are deprecated. Use aliases.  (SA1019)
cue/ast/astutil/resolve.go:436:17: ast.ParseIdent is deprecated: quoted identifiers are deprecated. Use aliases.  (SA1019)
cue/ast/astutil/util.go:81:22: from.Comments is deprecated: use ast.Comments  (SA1019)
cue/ast/astutil/util.go:98:22: from.Comments is deprecated: use ast.Comments  (SA1019)
cue/ast/astutil/walk.go:59:20: node.Comments is deprecated: use ast.Comments  (SA1019)
cue/build/instance.go:242:17: internal.PackageInfo is deprecated: use GetPackageInfo  (SA1019)
cue/build_test.go:259:7: p.AddFile is deprecated: use AddSyntax or wait for this to be renamed using a new signature.  (SA1019)
cue/format/format.go:292:18: node.Comments is deprecated: use ast.Comments  (SA1019)
cue/format/node.go:90:9: d.Comments is deprecated: use ast.Comments  (SA1019)
cue/format/node.go:95:14: x.Label.Comments is deprecated: use ast.Comments  (SA1019)
cue/interpreter/wasm/wasm_test.go:130:4: inst.AddFile is deprecated: use AddSyntax or wait for this to be renamed using a new signature.  (SA1019)
cue/load/loader_common.go:220:17: internal.PackageInfo is deprecated: use GetPackageInfo  (SA1019)
cue/load/loader_test.go:427:23: cue.Build is deprecated: use cuecontext.Context.BuildInstances. The use of Instance is being phased out.  (SA1019)
cue/marshal.go:65:7: p.AddFile is deprecated: use AddSyntax or wait for this to be renamed using a new signature.  (SA1019)
cue/marshal.go:153:18: internal.PackageInfo is deprecated: use GetPackageInfo  (SA1019)
cue/parser/parser.go:119:28: c.lastChild.Comments is deprecated: use ast.Comments  (SA1019)
cue/parser/parser.go:170:4: c.lastChild.AddComment is deprecated: use ast.AddComment  (SA1019)
cue/parser/parser.go:211:5: n.AddComment is deprecated: use ast.AddComment  (SA1019)
cuego/cuego.go:143:7: instance.Eval is deprecated: use inst.Value().Context().BuildExpr(expr, Scope(inst.Value), InferBuiltins(true))  (SA1019)
cuego/cuego.go:168:18: value.ConvertToRuntime(runtime).Compile is deprecated: use Parse or ParseBytes. The use of Instance is being phased out.  (SA1019)
doc/tutorial/kubernetes/tut_test.go:24:2: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package [io] or package [os], and those implementations should be preferred in new code. See the specific function documentation for details.  (SA1019)
encoding/gocode/generator_test.go:19:2: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package [io] or package [os], and those implementations should be preferred in new code. See the specific function documentation for details.  (SA1019)
encoding/gocode/generator_test.go:52:12: cue.Build is deprecated: use cuecontext.Context.BuildInstances. The use of Instance is being phased out.  (SA1019)
encoding/gocode/gocodec/codec.go:49:15: cue.Runtime is deprecated: use Context.  (SA1019)
encoding/gocode/gocodec/codec_test.go:104:10: cue.Runtime is deprecated: use Context.  (SA1019)
encoding/gocode/gocodec/codec_test.go:211:10: cue.Runtime is deprecated: use Context.  (SA1019)
encoding/gocode/gocodec/codec_test.go:220:18: r.Compile is deprecated: use Parse or ParseBytes. The use of Instance is being phased out.  (SA1019)
encoding/gocode/gocodec/codec_test.go:246:8: cue.Runtime is deprecated: use Context.  (SA1019)
encoding/gocode/gocodec/codec_test.go:251:17: r.Compile is deprecated: use Parse or ParseBytes. The use of Instance is being phased out.  (SA1019)
encoding/gocode/gocodec/codec_test.go:309:12: cue.Runtime is deprecated: use Context.  (SA1019)
encoding/gocode/gocodec/codec_test.go:339:8: cue.Runtime is deprecated: use Context.  (SA1019)
encoding/gocode/gocodec/codec_test.go:348:16: r.Compile is deprecated: use Parse or ParseBytes. The use of Instance is being phased out.  (SA1019)
encoding/json/json.go:46:15: r.Compile is deprecated: use Parse or ParseBytes. The use of Instance is being phased out.  (SA1019)
encoding/json/json.go:100:20: cue.Runtime is deprecated: use Context.  (SA1019)
encoding/json/json.go:111:10: cue.Runtime is deprecated: use Context.  (SA1019)
encoding/jsonschema/decode.go:79:13: v.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
encoding/jsonschema/decode_test.go:71:10: cue.Runtime is deprecated: use Context.  (SA1019)
encoding/jsonschema/decode_test.go:80:16: json.Decode is deprecated: use Extract and build using cue.Context.BuildExpr.  (SA1019)
encoding/jsonschema/decode_test.go:82:16: yaml.Decode is deprecated: use Extract and build the File with cue.Context.BuildFile.  (SA1019)
encoding/jsonschema/decode_test.go:123:18: r.Compile is deprecated: use Parse or ParseBytes. The use of Instance is being phased out.  (SA1019)
encoding/jsonschema/decode_test.go:163:8: cue.Runtime is deprecated: use Context.  (SA1019)
encoding/jsonschema/decode_test.go:169:14: json.Decode is deprecated: use Extract and build using cue.Context.BuildExpr.  (SA1019)
encoding/jsonschema/decode_test.go:174:14: yaml.Decode is deprecated: use Extract and build the File with cue.Context.BuildFile.  (SA1019)
encoding/openapi/build.go:133:17: (*cue.Runtime)(r).Build is deprecated: use Context.BuildInstance. The use of Instance is being phased out.  (SA1019)
encoding/openapi/build.go:133:19: cue.Runtime is deprecated: use Context.  (SA1019)
encoding/openapi/build.go:421:17: v.Reference is deprecated: use ReferencePath  (SA1019)
encoding/openapi/build.go:798:14: v.Elem is deprecated: use LookupPath in combination with "AnyString" or "AnyIndex".  (SA1019)
encoding/openapi/build.go:900:17: v.Elem is deprecated: use LookupPath in combination with "AnyString" or "AnyIndex".  (SA1019)
encoding/openapi/crd.go:116:11: v.Reference is deprecated: use ReferencePath  (SA1019)
encoding/openapi/crd.go:131:18: v.Elem is deprecated: use LookupPath in combination with "AnyString" or "AnyIndex".  (SA1019)
encoding/openapi/crd.go:143:18: v.Elem is deprecated: use LookupPath in combination with "AnyString" or "AnyIndex".  (SA1019)
encoding/openapi/decode.go:54:12: v.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
encoding/openapi/decode.go:55:13: v.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
encoding/openapi/decode.go:87:13: v.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
encoding/openapi/decode_test.go:60:10: cue.Runtime is deprecated: use Context.  (SA1019)
encoding/openapi/decode_test.go:68:16: json.Decode is deprecated: use Extract and build using cue.Context.BuildExpr.  (SA1019)
encoding/openapi/decode_test.go:70:16: yaml.Decode is deprecated: use Extract and build the File with cue.Context.BuildFile.  (SA1019)
encoding/openapi/decode_test.go:101:17: r.Compile is deprecated: use Parse or ParseBytes. The use of Instance is being phased out.  (SA1019)
encoding/openapi/openapi.go:151:6: i.IsDefinition is deprecated: use i.Selector().IsDefinition()  (SA1019)
encoding/openapi/openapi.go:168:15: i.Value().Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
encoding/openapi/openapi.go:169:17: i.Value().Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
encoding/openapi/openapi.go:189:17: val.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
encoding/openapi/openapi_test.go:274:14: cue.Build is deprecated: use cuecontext.Context.BuildInstances. The use of Instance is being phased out.  (SA1019)
encoding/openapi/openapi_test.go:313:8: cue.Runtime is deprecated: use Context.  (SA1019)
encoding/openapi/openapi_test.go:314:15: r.Compile is deprecated: use Parse or ParseBytes. The use of Instance is being phased out.  (SA1019)
encoding/openapi/openapi_test.go:332:8: cue.Runtime is deprecated: use Context.  (SA1019)
encoding/openapi/openapi_test.go:333:15: r.Compile is deprecated: use Parse or ParseBytes. The use of Instance is being phased out.  (SA1019)
encoding/protobuf/jsonpb/decoder.go:127:9: schema.Template is deprecated: use LookupPath in combination with using optional selectors.  (SA1019)
encoding/protobuf/jsonpb/decoder.go:174:14: schema.Elem is deprecated: use LookupPath in combination with "AnyString" or "AnyIndex".  (SA1019)
encoding/protobuf/jsonpb/decoder_test.go:39:7: cue.Runtime is deprecated: use Context.  (SA1019)
encoding/protobuf/jsonpb/decoder_test.go:50:18: r.Compile is deprecated: use Parse or ParseBytes. The use of Instance is being phased out.  (SA1019)
encoding/protobuf/jsonpb/decoder_test.go:112:8: cue.Runtime is deprecated: use Context.  (SA1019)
encoding/protobuf/jsonpb/decoder_test.go:113:15: r.Compile is deprecated: use Parse or ParseBytes. The use of Instance is being phased out.  (SA1019)
encoding/protobuf/jsonpb/encoder_test.go:35:7: cue.Runtime is deprecated: use Context.  (SA1019)
encoding/protobuf/jsonpb/encoder_test.go:46:18: r.Compile is deprecated: use Parse or ParseBytes. The use of Instance is being phased out.  (SA1019)
encoding/protobuf/jsonpb/encoder_test.go:64:17: r.CompileFile is deprecated: use BuildFile. The use of Instance is being phased out.  (SA1019)
encoding/protobuf/pbinternal/attribute.go:92:11: v.Elem is deprecated: use LookupPath in combination with "AnyString" or "AnyIndex".  (SA1019)
encoding/protobuf/pbinternal/attribute.go:119:11: v.Elem is deprecated: use LookupPath in combination with "AnyString" or "AnyIndex".  (SA1019)
encoding/protobuf/textproto/decoder.go:169:12: i.Value().Elem is deprecated: use LookupPath in combination with "AnyString" or "AnyIndex".  (SA1019)
encoding/protobuf/textproto/decoder_test.go:35:7: cue.Runtime is deprecated: use Context.  (SA1019)
encoding/protobuf/textproto/decoder_test.go:49:18: r.Compile is deprecated: use Parse or ParseBytes. The use of Instance is being phased out.  (SA1019)
encoding/protobuf/textproto/encoder_test.go:33:7: cue.Runtime is deprecated: use Context.  (SA1019)
encoding/protobuf/textproto/encoder_test.go:43:18: r.Compile is deprecated: use Parse or ParseBytes. The use of Instance is being phased out.  (SA1019)
encoding/protobuf/util.go:52:2: f.AddComment is deprecated: use ast.AddComment  (SA1019)
encoding/protobuf/util.go:53:2: f.AddComment is deprecated: use ast.AddComment  (SA1019)
encoding/protobuf/util.go:78:14: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.  (SA1019)
encoding/yaml/yaml_test.go:101:8: cue.Runtime is deprecated: use Context.  (SA1019)
encoding/yaml/yaml_test.go:131:14: r.Compile is deprecated: use Parse or ParseBytes. The use of Instance is being phased out.  (SA1019)
internal/astinternal/debugstr.go:30:21: n.Comments is deprecated: use ast.Comments  (SA1019)
internal/copy/copy.go:21:2: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package [io] or package [os], and those implementations should be preferred in new code. See the specific function documentation for details.  (SA1019)
internal/core/dep/dep_test.go:110:8: cue.Runtime is deprecated: use Context.  (SA1019)
internal/core/dep/dep_test.go:111:15: rt.Compile is deprecated: use Parse or ParseBytes. The use of Instance is being phased out.  (SA1019)
internal/core/dep/dep_test.go:116:7: inst.Lookup is deprecated: use Value.LookupPath  (SA1019)
internal/core/export/export.go:192:21: internal.PackageInfo is deprecated: use GetPackageInfo  (SA1019)
internal/core/export/export_test.go:310:8: cue.Runtime is deprecated: use Context.  (SA1019)
internal/core/export/self_test.go:19:2: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package [io] or package [os], and those implementations should be preferred in new code. See the specific function documentation for details.  (SA1019)
internal/core/runtime/build.go:104:12: p.AddFile is deprecated: use AddSyntax or wait for this to be renamed using a new signature.  (SA1019)
internal/core/runtime/build.go:122:20: internal.PackageInfo is deprecated: use GetPackageInfo  (SA1019)
internal/diff/diff.go:113:13: v.Struct is deprecated: use Fields.  (SA1019)
internal/diff/diff.go:134:13: es.x.Struct is deprecated: use Fields.  (SA1019)
internal/diff/diff.go:147:13: es.y.Struct is deprecated: use Fields.  (SA1019)
internal/diff/diff.go:207:49: cue.FieldInfo is deprecated: only used by deprecated functions.  (SA1019)
internal/diff/diff.go:210:10: cue.FieldInfo is deprecated: only used by deprecated functions.  (SA1019)
internal/diff/diff.go:216:11: x.Struct is deprecated: use Fields.  (SA1019)
internal/diff/diff.go:217:11: y.Struct is deprecated: use Fields.  (SA1019)
internal/diff/diff.go:246:13: cue.FieldInfo is deprecated: only used by deprecated functions.  (SA1019)
internal/diff/diff_test.go:406:10: cue.Runtime is deprecated: use Context.  (SA1019)
internal/diff/diff_test.go:407:14: r.Compile is deprecated: use Parse or ParseBytes. The use of Instance is being phased out.  (SA1019)
internal/diff/diff_test.go:411:14: r.Compile is deprecated: use Parse or ParseBytes. The use of Instance is being phased out.  (SA1019)
internal/diff/diff_test.go:455:8: cue.Runtime is deprecated: use Context.  (SA1019)
internal/diff/diff_test.go:456:12: r.Compile is deprecated: use Parse or ParseBytes. The use of Instance is being phased out.  (SA1019)
internal/diff/diff_test.go:460:12: r.Compile is deprecated: use Parse or ParseBytes. The use of Instance is being phased out.  (SA1019)
internal/encoding/detect.go:38:10: v.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
internal/encoding/detect.go:42:15: v.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
internal/encoding/detect.go:45:15: v.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
internal/encoding/detect.go:52:12: v.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
internal/encoding/detect_test.go:90:10: cue.Runtime is deprecated: use Context.  (SA1019)
internal/encoding/detect_test.go:91:17: r.Compile is deprecated: use Parse or ParseBytes. The use of Instance is being phased out.  (SA1019)
internal/encoding/encoder.go:126:4: cue.ResolveReferences is deprecated: Syntax will now always attempt to resolve dangling references and make the output self-contained. When Final or Concrete is used, it will already attempt to resolve all references. See also InlineImports.  (SA1019)
internal/encoding/encoder.go:277:8: cue.Runtime is deprecated: use Context.  (SA1019)
internal/encoding/encoder.go:278:15: r.CompileFile is deprecated: use BuildFile. The use of Instance is being phased out.  (SA1019)
internal/encoding/encoding.go:106:9: cue.Runtime is deprecated: use Context.  (SA1019)
internal/encoding/encoding.go:108:16: r.CompileFile is deprecated: use BuildFile. The use of Instance is being phased out.  (SA1019)
internal/encoding/encoding.go:284:12: i.Lookup is deprecated: use Value.LookupPath  (SA1019)
internal/filetypes/filetypes.go:101:7: i.LookupDef is deprecated: use LookupPath.  (SA1019)
internal/filetypes/filetypes.go:102:6: v.Fill is deprecated: use FillPath.  (SA1019)
internal/filetypes/filetypes.go:105:10: i.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
internal/filetypes/filetypes.go:111:23: v.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
internal/filetypes/filetypes.go:120:13: v.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
internal/filetypes/filetypes.go:135:14: i.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
internal/filetypes/filetypes.go:250:9: v.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
internal/filetypes/filetypes.go:256:6: v.Fill is deprecated: use FillPath.  (SA1019)
internal/filetypes/filetypes.go:261:17: i.LookupDef is deprecated: use LookupPath.  (SA1019)
internal/filetypes/filetypes.go:264:12: i.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
internal/filetypes/filetypes.go:287:14: i.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
internal/filetypes/filetypes.go:288:7: i.LookupDef is deprecated: use LookupPath.  (SA1019)
internal/filetypes/filetypes.go:293:9: v.Fill is deprecated: use FillPath.  (SA1019)
internal/filetypes/filetypes.go:295:13: i.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
internal/filetypes/types.go:14:9: cue.Runtime is deprecated: use Context.  (SA1019)
internal/filetypes/types.go:15:7: cue.Runtime is deprecated: use Context.  (SA1019)
internal/filetypes/types.go:29:12: cuegenInstance.Value().FieldByName is deprecated: use LookupPath.  (SA1019)
internal/task/task.go:41:7: c.Obj.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
internal/task/task.go:53:7: c.Obj.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
internal/task/task.go:63:7: c.Obj.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
internal/task/task.go:73:7: c.Obj.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
internal/third_party/yaml/decode.go:338:3: expr.AddComment is deprecated: use ast.AddComment  (SA1019)
internal/third_party/yaml/decode.go:356:3: expr.AddComment is deprecated: use ast.AddComment  (SA1019)
internal/value/value.go:31:40: cue.Runtime is deprecated: use Context.  (SA1019)
internal/value/value.go:32:11: cue.Runtime is deprecated: use Context.  (SA1019)
internal/value/value.go:35:28: cue.Runtime is deprecated: use Context.  (SA1019)
internal/value/value.go:36:27: cue.Runtime is deprecated: use Context.  (SA1019)
pkg/encoding/json/manual.go:100:8: cue.Runtime is deprecated: use Context.  (SA1019)
pkg/tool/exec/exec.go:48:8: ctx.Obj.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
pkg/tool/exec/exec.go:137:15: ctx.Obj.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
pkg/tool/exec/exec.go:139:9: ctx.Obj.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
pkg/tool/exec/exec.go:152:17: ctx.Obj.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
pkg/tool/exec/exec_test.go:52:10: cue.Runtime is deprecated: use Context.  (SA1019)
pkg/tool/exec/exec_test.go:53:17: r.Compile is deprecated: use Parse or ParseBytes. The use of Instance is being phased out.  (SA1019)
pkg/tool/file/file_test.go:19:2: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package [io] or package [os], and those implementations should be preferred in new code. See the specific function documentation for details.  (SA1019)
pkg/tool/file/file_test.go:38:8: cue.Runtime is deprecated: use Context.  (SA1019)
pkg/tool/file/file_test.go:39:12: r.CompileExpr is deprecated: use BuildExpr. The use of Instance is being phased out.  (SA1019)
pkg/tool/http/http.go:50:12: ctx.Obj.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
pkg/tool/http/http.go:51:11: obj.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
pkg/tool/http/http.go:146:7: obj.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
pkg/tool/http/http_test.go:46:8: cue.Runtime is deprecated: use Context.  (SA1019)
pkg/tool/http/http_test.go:47:12: r.CompileExpr is deprecated: use BuildExpr. The use of Instance is being phased out.  (SA1019)
pkg/tool/http/http_test.go:136:9: cue.Runtime is deprecated: use Context.  (SA1019)
pkg/tool/http/http_test.go:137:17: r.Compile is deprecated: use Parse or ParseBytes. The use of Instance is being phased out.  (SA1019)
pkg/tool/os/env.go:106:11: ctx.Obj.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
pkg/tool/os/env_test.go:138:8: cue.Runtime is deprecated: use Context.  (SA1019)
pkg/tool/os/env_test.go:139:12: r.CompileExpr is deprecated: use BuildExpr. The use of Instance is being phased out.  (SA1019)
tools/flow/flow_test.go:161:22: v.Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
tools/flow/flow_test.go:175:19: t.Value().Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
tools/flow/flow_test.go:208:16: t.Value().Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
tools/flow/flow_test.go:215:19: t.Value().Lookup is deprecated: use LookupPath. At some point before v1.0.0, this method will be removed to be reused eventually for looking up a selector.  (SA1019)
tools/trim/trim_test.go:325:10: cue.Build is deprecated: use cuecontext.Context.BuildInstances. The use of Instance is being phased out.  (SA1019)

cueckoo pushed a commit that referenced this issue Jul 12, 2023
The shared `*cue.Instance` used by the filetypes logic was causing
a race when loading. Using `cue.Value` instead avoids the race because
`cue.Value` is already finalized.

Updates #1746, #2480.

Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I48819188f1f0bbda62909f3aea8675953e2d8fc2
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/556519
Reviewed-by: Marcel van Lohuizen <mpvl@gmail.com>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo+gerrithub@cuelang.org>
Reviewed-by: Paul Jolly <paul@myitcv.io>
@mvdan mvdan added the good first issue Good for newcomers label Oct 21, 2023
cueckoo pushed a commit that referenced this issue May 13, 2024
This removes some deprecated API usages in the astutil package.

While here, fix a few typos.

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: I3a4f424379a1bdb7e82c67841f891e292f3f0d09
cueckoo pushed a commit that referenced this issue May 13, 2024
This removes some deprecated API usages in the astutil package.

While here, fix a typo and some unordered imports.

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: I3a4f424379a1bdb7e82c67841f891e292f3f0d09
cueckoo pushed a commit that referenced this issue May 13, 2024
This removes some deprecated API usages in the astutil package.

While here, fix a typo and some unordered imports.

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: I3a4f424379a1bdb7e82c67841f891e292f3f0d09
cueckoo pushed a commit that referenced this issue May 13, 2024
This removes some deprecated API usages in the filetypes package.

While here, fix some unordered imports.

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: Ic578b5a25a8839caa28da69930b7dcb597d6c2ec
cueckoo pushed a commit that referenced this issue May 13, 2024
The PackageInfo method was declared deprecated. This CL replaces all
usages of this method with the newer GetPackageInfo method (which is
what PackageInfo called behind the scenes), and removes the PackageInfo
function.

In addition, the code is reorganized slightly to move some vars to a
smaller scope closer to their usage.

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: Idb5a0d24d2cb5ef6d34bd17fdd5718b55c4bb465
cueckoo pushed a commit that referenced this issue May 13, 2024
The PackageInfo method was declared deprecated. This CL replaces all
usages of this method with the newer GetPackageInfo method (which is
what PackageInfo called behind the scenes), and removes the PackageInfo
function.

In addition, the code is reorganized slightly to move some vars to a
smaller scope closer to their usage.

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: Idb5a0d24d2cb5ef6d34bd17fdd5718b55c4bb465
cueckoo pushed a commit that referenced this issue May 13, 2024
This removes some deprecated API usages in the astutil package.

While here, fix a typo and some unordered imports.

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: I3a4f424379a1bdb7e82c67841f891e292f3f0d09
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194643
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
cueckoo pushed a commit that referenced this issue May 13, 2024
This removes some deprecated API usages in the filetypes package.

While here, fix some unordered imports.

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: Ic578b5a25a8839caa28da69930b7dcb597d6c2ec
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194645
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
cueckoo pushed a commit that referenced this issue May 13, 2024
The PackageInfo method was declared deprecated. This CL replaces all
usages of this method with the newer GetPackageInfo method (which is
what PackageInfo called behind the scenes), and removes the PackageInfo
function.

In addition, the code is reorganized slightly to move some vars to a
smaller scope closer to their usage.

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: Idb5a0d24d2cb5ef6d34bd17fdd5718b55c4bb465
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194646
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
cueckoo pushed a commit that referenced this issue May 14, 2024
*cue.Instance is deprecated and being replaced by cue.Value. This
CL replaces the usage of a *cue.Instance by the equivalent
cue.Context method.

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: Idb1c4a3dab4144fe62bcb1f58deb926fb46082e0
cueckoo pushed a commit that referenced this issue May 14, 2024
Some usages of the following deprecated types and methods are replaced
by their non-deprecated equivalents

    - cue.Runtime
    - Value.Lookup
    - ast.Node.AddComment

Various usages of these are removed and replaced with the non-deprecated
versions.

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: I501fbdc518b3edf122ec13b751502f15e2372244
cueckoo pushed a commit that referenced this issue May 14, 2024
Some usages of the following deprecated types and methods are replaced
by their non-deprecated equivalents:

    - cue.Runtime
    - Value.Lookup
    - ast.Node.AddComment

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: I501fbdc518b3edf122ec13b751502f15e2372244
cueckoo pushed a commit that referenced this issue May 14, 2024
Some usages of the following deprecated types and methods are replaced
by their non-deprecated equivalents:

    - cue.Runtime
    - Value.Lookup
    - ast.Node.AddComment

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: I501fbdc518b3edf122ec13b751502f15e2372244
cueckoo pushed a commit that referenced this issue May 14, 2024
*cue.Instance is deprecated and being replaced by cue.Value. This
CL replaces the usage of a *cue.Instance by the equivalent
cue.Context method.

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: Idb1c4a3dab4144fe62bcb1f58deb926fb46082e0
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194691
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
cueckoo pushed a commit that referenced this issue May 14, 2024
Some usages of the following deprecated types and methods are replaced
by their non-deprecated equivalents:

    - cue.Runtime
    - Value.Lookup
    - ast.Node.AddComment

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: I501fbdc518b3edf122ec13b751502f15e2372244
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194692
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
cueckoo pushed a commit that referenced this issue May 14, 2024
This CL removes the last remaining usages of the deprecated
ast.Node.Comments method in the cue codebase.

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: Ib1ab7bd84da50cd7ee07e54c338273b91c5df0c1
cueckoo pushed a commit that referenced this issue May 14, 2024
This CL removes the last remaining usages of the deprecated
ast.Node.Comments and ast.Node.AddComment methods in the cue codebase.

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: Ib1ab7bd84da50cd7ee07e54c338273b91c5df0c1
cueckoo pushed a commit that referenced this issue May 14, 2024
This CL removes the last remaining usages of the deprecated
ast.Node.Comments and ast.Node.AddComment methods in the cue codebase.

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: Ib1ab7bd84da50cd7ee07e54c338273b91c5df0c1
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194709
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
cueckoo pushed a commit that referenced this issue May 17, 2024
This removes most usages of cue.Runtime in gocodec tests, except for a
smoke test that ensures the deprecated cue.Runtime still works with
the API.

Also, the package doc is fixed to reference the correct package name.

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: I464e0d730fbdfaf5afc8bebd547b7f1590f2dd93
cueckoo pushed a commit that referenced this issue May 17, 2024
This removes most usages of cue.Runtime in gocodec tests, except for a
smoke test that ensures the deprecated cue.Runtime still works with
the API.

Also, the package doc is fixed to reference the correct package name.

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: I464e0d730fbdfaf5afc8bebd547b7f1590f2dd93
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194862
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
cueckoo pushed a commit that referenced this issue May 17, 2024
This replaces various usages of cue.Runtime in tests with the equivalent
*cue.Context methods.

`cuecontext.New` can't be used directly, as this causes an import cycle.
A `newContext` method already existed for creating a cue.Context, and
is extracted to a shared internal func for reuse across pkg/...

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: I9bcf3011096a17c3a7f81e80c57414a9b9d9b7b2
cueckoo pushed a commit that referenced this issue May 17, 2024
This replaces various usages of cue.Runtime in tests with the equivalent
*cue.Context methods.

`cuecontext.New` can't be used directly, as this causes an import cycle.
A `newContext` method already existed for creating a cue.Context, and
is extracted to a shared internal func for reuse across pkg/...

Also, some typos are fixed.

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: I9bcf3011096a17c3a7f81e80c57414a9b9d9b7b2
cueckoo pushed a commit that referenced this issue May 17, 2024
This replaces various usages of cue.Runtime in tests with the equivalent
*cue.Context methods.

`cuecontext.New` can't be used directly, as this causes an import cycle.
A `newContext` method already existed for creating a cue.Context, and
is extracted to a shared internal func for reuse across pkg/...

Also, some typos are fixed.

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: I9bcf3011096a17c3a7f81e80c57414a9b9d9b7b2
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194868
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
cueckoo pushed a commit that referenced this issue May 20, 2024
Replace various usages of the deprecated cue.Value.Lookup with
cue.Value.LookupPath.

Also, fix some typos and reorganize some imports.

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: I8faff629c07601dcb51fda527d8f10b80265bd92
cueckoo pushed a commit that referenced this issue May 20, 2024
Replace various usages of the deprecated cue.Value.Lookup with
cue.Value.LookupPath.

Also, fix some typos and reorganize some imports.

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: I8faff629c07601dcb51fda527d8f10b80265bd92
cueckoo pushed a commit that referenced this issue May 20, 2024
Replace various usages of the deprecated cue.Value.Lookup with
cue.Value.LookupPath.

Also, fix some typos and reorganize some imports.

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: I8faff629c07601dcb51fda527d8f10b80265bd92
cueckoo pushed a commit that referenced this issue May 20, 2024
Replace various usages of the deprecated cue.Value.Lookup with
cue.Value.LookupPath.

Also, fix some typos and reorganize some imports.

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: I8faff629c07601dcb51fda527d8f10b80265bd92
cueckoo pushed a commit that referenced this issue May 20, 2024
Replace various usages of the deprecated cue.Value.Lookup with
cue.Value.LookupPath.

Also, fix some typos and reorganize some imports.

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: I8faff629c07601dcb51fda527d8f10b80265bd92
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194951
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
cueckoo pushed a commit that referenced this issue Jun 13, 2024
This fixes various errors found by staticcheck:

  - an unused method is removed
  - various usages of cue.Runtime are replaced by cue.Context
  - the default case of a switch statement is moved to be last

Updates #2480.

Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com>
Change-Id: I0945d3c63fcd581aa7a6f198bc74fc1a56841b5c
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1196248
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants