...

Source file src/github.com/rogpeppe/go-internal/goproxytest/allhex.go

Documentation: github.com/rogpeppe/go-internal/goproxytest

     1  // Copyright 2018 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package goproxytest
     6  
     7  // This code was taken from src/cmd/go/internal/modfetch/codehost.
     8  
     9  // allHex reports whether the revision rev is entirely lower-case hexadecimal digits.
    10  func allHex(rev string) bool {
    11  	for i := 0; i < len(rev); i++ {
    12  		c := rev[i]
    13  		if '0' <= c && c <= '9' || 'a' <= c && c <= 'f' {
    14  			continue
    15  		}
    16  		return false
    17  	}
    18  	return true
    19  }
    20  

View as plain text