Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 74 for parseBool (0.16 sec)

  1. src/strconv/atob.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package strconv
    
    // ParseBool returns the boolean value represented by the string.
    // It accepts 1, t, T, TRUE, true, True, 0, f, F, FALSE, false, False.
    // Any other value returns an error.
    func ParseBool(str string) (bool, error) {
    	switch str {
    	case "1", "t", "T", "true", "TRUE", "True":
    		return true, nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Jun 09 01:26:25 UTC 2018
    - 974 bytes
    - Viewed (0)
  2. src/strconv/atob_test.go

    func TestParseBool(t *testing.T) {
    	for _, test := range atobtests {
    		b, e := ParseBool(test.in)
    		if test.err != nil {
    			// expect an error
    			if e == nil {
    				t.Errorf("ParseBool(%s) = nil; want %s", test.in, test.err)
    			} else {
    				// NumError assertion must succeed; it's the only thing we return.
    				if e.(*NumError).Err != test.err {
    					t.Errorf("ParseBool(%s) = %s; want %s", test.in, e, test.err)
    				}
    			}
    		} else {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 24 18:08:43 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  3. internal/config/bool-flag.go

    func FormatBool(b bool) string {
    	if b {
    		return "on"
    	}
    	return "off"
    }
    
    // ParseBool returns the boolean value represented by the string.
    // It accepts 1, t, T, TRUE, true, True, 0, f, F, FALSE, false, False.
    // Any other value returns an error.
    func ParseBool(str string) (bool, error) {
    	switch str {
    	case "1", "t", "T", "true", "TRUE", "True", "on", "ON", "On":
    		return true, nil
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Apr 07 15:10:40 UTC 2022
    - 2.3K bytes
    - Viewed (0)
  4. src/strconv/strconv_test.go

    				t.Errorf("got %v allocs, want 0 allocs", allocs)
    			}
    		}
    	}
    
    	t.Run("Atoi", checkNoAllocs(func() {
    		Sink.Int, Sink.Error = Atoi(string(bytes.Number))
    	}))
    	t.Run("ParseBool", checkNoAllocs(func() {
    		Sink.Bool, Sink.Error = ParseBool(string(bytes.Bool))
    	}))
    	t.Run("ParseInt", checkNoAllocs(func() {
    		Sink.Int64, Sink.Error = ParseInt(string(bytes.Number), 10, 64)
    	}))
    	t.Run("ParseUint", checkNoAllocs(func() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 23 20:29:22 UTC 2022
    - 4.7K bytes
    - Viewed (0)
  5. pkg/kubelet/cm/cpumanager/policy_options.go

    			return opts, err
    		}
    
    		switch name {
    		case FullPCPUsOnlyOption:
    			optValue, err := strconv.ParseBool(value)
    			if err != nil {
    				return opts, fmt.Errorf("bad value for option %q: %w", name, err)
    			}
    			opts.FullPhysicalCPUsOnly = optValue
    		case DistributeCPUsAcrossNUMAOption:
    			optValue, err := strconv.ParseBool(value)
    			if err != nil {
    				return opts, fmt.Errorf("bad value for option %q: %w", name, err)
    			}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Sep 27 13:02:15 UTC 2023
    - 5.1K bytes
    - Viewed (0)
  6. src/strconv/doc.go

    //
    //	i, err := strconv.Atoi("-42")
    //	s := strconv.Itoa(-42)
    //
    // These assume decimal and the Go int type.
    //
    // [ParseBool], [ParseFloat], [ParseInt], and [ParseUint] convert strings to values:
    //
    //	b, err := strconv.ParseBool("true")
    //	f, err := strconv.ParseFloat("3.1415", 64)
    //	i, err := strconv.ParseInt("-42", 10, 64)
    //	u, err := strconv.ParseUint("42", 10, 64)
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:21:28 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  7. internal/config/identity/ldap/config.go

    		isEnableFlagExplicitlySet = true
    		l.LDAP.Enabled, err = config.ParseBool(v)
    		if err != nil {
    			return l, err
    		}
    	}
    
    	l.stsExpiryDuration = defaultLDAPExpiry
    
    	// LDAP connection configuration
    	if v := getCfgVal(ServerInsecure); v != "" {
    		l.LDAP.ServerInsecure, err = config.ParseBool(v)
    		if err != nil {
    			return l, err
    		}
    	}
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  8. internal/config/identity/tls/config.go

    	}
    	cfg := Config{}
    	var err error
    	v := env.Get(EnvIdentityTLSEnabled, "")
    	if v == "" {
    		return cfg, nil
    	}
    	cfg.Enabled, err = config.ParseBool(v)
    	if err != nil {
    		return Config{}, err
    	}
    	cfg.InsecureSkipVerify, err = config.ParseBool(env.Get(EnvIdentityTLSSkipVerify, kvs.Get(skipVerify)))
    	if err != nil {
    		return Config{}, err
    	}
    	return cfg, nil
    }
    
    const (
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  9. cni/pkg/plugin/sidecar_redirect.go

    		// parse and set the bool value of dnsRedirect
    		redir.dnsRedirect, valErr = strconv.ParseBool(v)
    		if valErr != nil {
    			log.Warnf("cannot parse DNS capture environment variable %v", valErr)
    		}
    	}
    	if v, found := pi.ProxyEnvironments["ISTIO_DUAL_STACK"]; found {
    		// parse and set the bool value of dnsRedirect
    		redir.dualStack, valErr = strconv.ParseBool(v)
    		if valErr != nil {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Jan 26 20:34:28 UTC 2024
    - 10.6K bytes
    - Viewed (0)
  10. internal/config/compress/compress.go

    		return cfg, err
    	}
    
    	compress := env.Get(EnvCompressState, kvs.Get(config.Enable))
    	if compress == "" {
    		compress = env.Get(EnvCompress, "")
    	}
    	cfg.Enabled, err = config.ParseBool(compress)
    	if err != nil {
    		// Parsing failures happen due to empty KVS, ignore it.
    		if kvs.Empty() {
    			return cfg, nil
    		}
    		return cfg, err
    	}
    	if !cfg.Enabled {
    		return cfg, nil
    	}
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 5K bytes
    - Viewed (0)
Back to top