Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for ParseValue (0.2 sec)

  1. operator/pkg/util/util.go

    			return nil
    		})
    		if err != nil {
    			return nil, err
    		}
    	} else {
    		fileList = append(fileList, path)
    	}
    	return fileList, nil
    }
    
    // ParseValue parses string into a value
    func ParseValue(valueStr string) any {
    	var value any
    	if v, err := strconv.Atoi(valueStr); err == nil {
    		value = v
    	} else if v, err := strconv.ParseFloat(valueStr, 64); err == nil {
    		value = v
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 02 13:01:43 UTC 2023
    - 3.9K bytes
    - Viewed (0)
  2. operator/pkg/util/util_test.go

    			want: "foobar",
    		},
    		{
    			desc: "string-number-prefix",
    			in:   "123foobar",
    			want: "123foobar",
    		},
    	}
    	for _, tt := range tests {
    		t.Run(tt.desc, func(t *testing.T) {
    			if got, want := ParseValue(tt.in), tt.want; !(got == want) {
    				t.Errorf("%s: got:%v, want:%v", tt.desc, got, want)
    			}
    		})
    	}
    }
    
    func TestConsolidateLog(t *testing.T) {
    	tests := []struct {
    		desc string
    		in   string
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jul 25 19:30:47 UTC 2022
    - 4.9K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/ssa/_gen/rulegen.go

    			args = append(args, a)
    		}
    	}
    	return
    }
    
    // parseValue parses a parenthesized value from a rule.
    // The value can be from the match or the result side.
    // It returns the op and unparsed strings for typ, auxint, and aux restrictions and for all args.
    // oparch is the architecture that op is located in, or "" for generic.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Sep 02 22:09:21 UTC 2023
    - 48.7K bytes
    - Viewed (0)
  4. operator/pkg/manifest/shared.go

    	for _, kv := range setOverlay {
    		kvv := strings.Split(kv, "=")
    		if len(kvv) != 2 {
    			return "", fmt.Errorf("bad argument %s: expect format key=value", kv)
    		}
    		k := kvv[0]
    		v := util.ParseValue(kvv[1])
    		if err := tpath.WriteNode(tree, util.PathFromString(k), v); err != nil {
    			return "", err
    		}
    		// To make errors more user friendly, test the path and error out immediately if we cannot unmarshal.
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Apr 03 06:27:07 UTC 2024
    - 19.7K bytes
    - Viewed (0)
  5. src/go/parser/parser.go

    }
    
    func (p *parser) parseValue() ast.Expr {
    	if p.trace {
    		defer un(trace(p, "Element"))
    	}
    
    	if p.tok == token.LBRACE {
    		return p.parseLiteralValue(nil)
    	}
    
    	x := p.parseExpr()
    
    	return x
    }
    
    func (p *parser) parseElement() ast.Expr {
    	if p.trace {
    		defer un(trace(p, "Element"))
    	}
    
    	x := p.parseValue()
    	if p.tok == token.COLON {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 08 20:07:50 UTC 2023
    - 72.2K bytes
    - Viewed (0)
Back to top