INNER CODE UNIT · Go

trimLeadingComment

kubernetes-sigs/kwok · hack/verify_boilerplate/main.go:57

func trimLeadingComment(line, c string) string {
	if strings.Index(line, c) == 0 {
		x := len(c)
		if len(line) == x {
			return ""
		}
		if line[x] == byte(' ') {
			return line[x+1:]
		}
		return line[x:]
	}
	return line
}

// verifyFileExtension verifies if the file extensions is supported
func isSupportedFileExtension(filePath string) bool {
	// check if the file has an extension
	idx := strings.LastIndex(filePath, ".")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…