Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 63 for TrimSpace (0.21 sec)

  1. operator/cmd/mesh/test-util_test.go

    func toMap(s string) map[string]any {
    	out := make(map[string]any)
    	for _, l := range strings.Split(s, ",") {
    		l = strings.TrimSpace(l)
    		kv := strings.Split(l, ":")
    		if len(kv) != 2 {
    			panic("bad key:value in " + s)
    		}
    		out[strings.TrimSpace(kv[0])] = strings.TrimSpace(kv[1])
    	}
    	if len(out) == 0 {
    		return nil
    	}
    	return out
    }
    
    Go
    - Registered: Wed Mar 20 22:53:08 GMT 2024
    - Last Modified: Tue Oct 31 14:48:28 GMT 2023
    - 15.3K bytes
    - Viewed (0)
  2. cmd/leak-detect_test.go

    		// Again split on a new line, the first line of the second half contains the info about the go routine.
    		sl := strings.SplitN(g, "\n", 2)
    		if len(sl) != 2 {
    			continue
    		}
    		stack := strings.TrimSpace(sl[1])
    		// ignore the testing go routine.
    		// since the tests will be invoking the leaktest it would contain the test go routine.
    		if strings.HasPrefix(stack, "testing.RunTests") {
    			continue
    		}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 5.2K bytes
    - Viewed (0)
  3. cni/pkg/log/uds.go

    	for _, l := range cniLogs {
    		var msg cniLog
    		if err := json.Unmarshal([]byte(l), &msg); err != nil {
    			log.Debugf("Failed to unmarshal CNI plugin log entry: %v", err)
    			continue
    		}
    		msg.Msg = strings.TrimSpace(msg.Msg)
    		messages = append(messages, msg)
    	}
    	// Lock log message printing to prevent log messages from different CNI
    	// processes interleave.
    	l.mu.Lock()
    	defer l.mu.Unlock()
    	for _, m := range messages {
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Wed Nov 29 01:05:12 GMT 2023
    - 3.3K bytes
    - Viewed (0)
  4. misc/ios/detect.go

    }
    
    func plistExtract(fname string, path string) ([]byte, error) {
    	out, err := exec.Command("/usr/libexec/PlistBuddy", "-c", "Print "+path, fname).CombinedOutput()
    	if err != nil {
    		return nil, err
    	}
    	return bytes.TrimSpace(out), nil
    }
    
    func getLines(cmd *exec.Cmd) [][]byte {
    	out := output(cmd)
    	lines := bytes.Split(out, []byte("\n"))
    	// Skip the empty line at the end.
    	if len(lines[len(lines)-1]) == 0 {
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Oct 19 23:33:30 GMT 2023
    - 3.2K bytes
    - Viewed (0)
  5. cmd/generic-handlers.go

    		// if the caller sends path of following style
    		// a/a/a/a/a/a/a/a...
    		return true
    	}
    	path = filepath.ToSlash(strings.TrimSpace(path)) // For windows '\' must be converted to '/'
    	for _, p := range strings.Split(path, SlashSeparator) {
    		switch strings.TrimSpace(p) {
    		case dotdotComponent:
    			return true
    		case dotComponent:
    			return true
    		}
    	}
    	return false
    }
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 11 01:08:52 GMT 2024
    - 20.7K bytes
    - Viewed (0)
  6. docs/debugging/hash-set/main.go

    		b, err := os.ReadFile(file)
    		if err != nil {
    			log.Fatalln(err)
    		}
    		b = bytes.ReplaceAll(b, []byte("\r"), []byte{})
    		sc := bufio.NewScanner(bytes.NewBuffer(b))
    		for sc.Scan() {
    			object = strings.TrimSpace(sc.Text())
    			set := sipHashMod(prefix+object, setCount, id)
    			distrib[set] = append(distrib[set], prefix+object)
    		}
    		for set, files := range distrib {
    			fmt.Println("Set:", set+1, "Objects:", len(files))
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Sep 19 18:05:16 GMT 2022
    - 3.7K bytes
    - Viewed (0)
  7. docs/debugging/inspect/main.go

    			reader := bufio.NewReader(os.Stdin)
    			fmt.Print("Enter Decryption Key: ")
    
    			text, _ := reader.ReadString('\n')
    			// convert CRLF to LF
    			*keyHex = strings.ReplaceAll(text, "\n", "")
    			*keyHex = strings.TrimSpace(*keyHex)
    		}
    	}
    
    	var inputFileName, outputFileName string
    
    	// Parse parameters
    	switch {
    	case *stdin:
    		// Parse 'mc support inspect --json' output
    		input := struct {
    			File string `json:"file"`
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 11 21:22:47 GMT 2024
    - 4.8K bytes
    - Viewed (0)
  8. cmd/streaming-v4-unsigned.go

    	for k := range cr.trailers {
    		wantTrailers[strings.ToLower(k)] = struct{}{}
    	}
    	input := bufio.NewScanner(bytes.NewReader(valueBuffer.Bytes()))
    	for input.Scan() {
    		line := strings.TrimSpace(input.Text())
    		if line == "" {
    			continue
    		}
    		// Find first separator.
    		idx := strings.IndexByte(line, trailerKVSeparator[0])
    		if idx <= 0 || idx >= len(line) {
    			if cr.debug {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sat May 06 02:53:12 GMT 2023
    - 6.1K bytes
    - Viewed (1)
  9. cmd/server-startup-msg.go

    func printServerCommonMsg(apiEndpoints []string) {
    	// Get saved credentials.
    	cred := globalActiveCred
    
    	// Get saved region.
    	region := globalSite.Region
    
    	apiEndpointStr := strings.TrimSpace(strings.Join(apiEndpoints, "  "))
    	// Colorize the message and print.
    	logger.Info(color.Blue("API: ") + color.Bold(fmt.Sprintf("%s ", apiEndpointStr)))
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sat Mar 09 03:07:08 GMT 2024
    - 6.8K bytes
    - Viewed (0)
  10. internal/disk/stat_linux.go

    	if err != nil {
    		return nil, err
    	}
    	defer file.Close()
    
    	s, err := bufio.NewReader(file).ReadString('\n')
    	if err != nil && !errors.Is(err, io.EOF) {
    		return nil, err
    	}
    	statLine := strings.TrimSpace(s)
    	for _, token := range strings.Fields(statLine) {
    		ui64, err := strconv.ParseUint(token, 10, 64)
    		if err != nil {
    			return nil, err
    		}
    		stats = append(stats, ui64)
    	}
    
    	return stats, nil
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Feb 26 19:34:50 GMT 2024
    - 4.8K bytes
    - Viewed (0)
Back to top