Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for exactly16Bytes (0.28 sec)

  1. src/cmd/internal/archive/archive_test.go

    		"1234567890123456日本語7日本語890",
    	}
    	for _, str := range tests {
    		got := exactly16Bytes(str)
    		if len(got) != 16 {
    			t.Errorf("exactly16Bytes(%q) is %q, length %d", str, got, len(got))
    		}
    		// Make sure it is full runes.
    		for _, c := range got {
    			if c == utf8.RuneError {
    				t.Errorf("exactly16Bytes(%q) is %q, has partial rune", str, got)
    			}
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 02 19:27:33 UTC 2023
    - 7.9K bytes
    - Viewed (0)
  2. src/cmd/internal/archive/archive.go

    		Gid:   gid,
    		Mode:  mode,
    		Data:  Data{off + entryLen, size},
    	})
    }
    
    // exactly16Bytes truncates the string if necessary so it is at most 16 bytes long,
    // then pads the result with spaces to be exactly 16 bytes.
    // Fmt uses runes for its width calculation, but we need bytes in the entry header.
    func exactly16Bytes(s string) string {
    	for len(s) > 16 {
    		_, wid := utf8.DecodeLastRuneInString(s)
    		s = s[:len(s)-wid]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 15 15:39:57 UTC 2023
    - 12.1K bytes
    - Viewed (0)
Back to top