@@ -869,7 +869,7 @@ func main() {
869869 return toExitError (err )
870870 }
871871
872- var extract []interface {}
872+ var extract []any
873873 extract , err = parseTreePath (c .String ("extract" ))
874874 if err != nil {
875875 return common .NewExitError (fmt .Errorf ("error parsing --extract path: %s" , err ), codes .InvalidTreePathFormat )
@@ -1988,7 +1988,7 @@ func main() {
19881988 }
19891989
19901990 if isDecryptMode {
1991- var extract []interface {}
1991+ var extract []any
19921992 extract , err = parseTreePath (c .String ("extract" ))
19931993 if err != nil {
19941994 return common .NewExitError (fmt .Errorf ("error parsing --extract path: %s" , err ), codes .InvalidTreePathFormat )
@@ -2019,8 +2019,8 @@ func main() {
20192019 }
20202020
20212021 if isSetMode {
2022- var path []interface {}
2023- var value interface {}
2022+ var path []any
2023+ var value any
20242024 path , value , err = extractSetArguments (c .String ("set" ))
20252025 if err != nil {
20262026 return toExitError (err )
@@ -2398,10 +2398,10 @@ func outputStore(context *cli.Context, path string) (common.Store, error) {
23982398 return common .DefaultStoreForPathOrFormat (storesConf , path , context .String ("output-type" )), nil
23992399}
24002400
2401- func parseTreePath (arg string ) ([]interface {} , error ) {
2402- var path []interface {}
2403- components := strings .Split (arg , "[" )
2404- for _ , component := range components {
2401+ func parseTreePath (arg string ) ([]any , error ) {
2402+ var path []any
2403+ components := strings .SplitSeq (arg , "[" )
2404+ for component := range components {
24052405 if component == "" {
24062406 continue
24072407 }
@@ -2554,8 +2554,8 @@ func shamirThreshold(c *cli.Context, file string, optionalConfig *config.Config)
25542554 return conf .ShamirThreshold , nil
25552555}
25562556
2557- func jsonValueToTreeInsertableValue (jsonValue string ) (interface {} , error ) {
2558- var valueToInsert interface {}
2557+ func jsonValueToTreeInsertableValue (jsonValue string ) (any , error ) {
2558+ var valueToInsert any
25592559 err := encodingjson .Unmarshal ([]byte (jsonValue ), & valueToInsert )
25602560 if err != nil {
25612561 return nil , common .NewExitError ("Value for --set is not valid JSON" , codes .ErrorInvalidSetFormat )
@@ -2581,7 +2581,7 @@ func jsonValueToTreeInsertableValue(jsonValue string) (interface{}, error) {
25812581 return values [0 ], nil
25822582}
25832583
2584- func extractSetArguments (set string ) (path []interface {} , valueToInsert interface {} , err error ) {
2584+ func extractSetArguments (set string ) (path []any , valueToInsert any , err error ) {
25852585 // Set is a string with the format "python-dict-index json-value"
25862586 // Since python-dict-index has to end with ], we split at "] " to get the two parts
25872587 pathValuePair := strings .SplitAfterN (set , "] " , 2 )
0 commit comments