<commit_before>package main

import (
	"bytes"
	"strings"
)

func createKey(path string) string {
	var buffer bytes.Buffer
	buffer.WriteString(*uploadpath)
	if *uploadpath == "/" {
		if startWith(path, "/") {
			return path
		}
		buffer.WriteString(path)
		return buffer.String()
	} else {
		if !endWith(*uploadpath, "/") && !startWith(path, "/") {
			buffer.WriteString("/")
		}
		if endWith(*uploadpath, "/") && startWith(path, "/") {
			buffer.WriteString(string(path[1:]))
		} else {
			buffer.WriteString(path)
		}
		return buffer.String()
	}
}

func startWith(original, substring string) bool {
	if len(substring) > len(original) {
		return false
	}
	str := string(original[0:len(substring)])
	return str == substring
}

func endWith(original, substring string) bool {
	if len(substring) > len(original) {
		return false
	}
	str := string(original[len(original)-len(substring):])
	return str == substring
}

func getFileName(filepath string) string {
	if *rename != "" {
		return *rename
	}
	index := strings.LastIndex(filepath, "/")
	if index == -1 {
		return filepath
	}
	return filepath[index+1:]
}

func getFolderName(filepath string) string {
	if endWith(filepath, "/") {
		pos := strings.LastIndex(string(filepath[:len(filepath)-1]), "/")
		return string(filepath[pos+1 : len(filepath)-1])
	} else {
		pos := strings.LastIndex(filepath, "/")
		return string(filepath[pos+1:])
	}
}

func getPathInsideFolder(path, folder string) string {
	pos := strings.Index(path, folder)
	var result string
	if pos != -1 {
		result = string(path[pos-1:])
	}
	return result
}<commit_msg>Fix golint issues<commit_after>package main

import (
	"bytes"
	"strings"
)

func createKey(path string) string {
	var buffer bytes.Buffer
	buffer.WriteString(*uploadpath)
	if *uploadpath == "/" {
		if startWith(path, "/") {
			return path
		}
		buffer.WriteString(path)
	} else {
		if !endWith(*uploadpath, "/") && !startWith(path, "/") {
			buffer.WriteString("/")
		}
		if endWith(*uploadpath, "/") && startWith(path, "/") {
			buffer.WriteString(string(path[1:]))
		} else {
			buffer.WriteString(path)
		}
	}
	return buffer.String()
}

func startWith(original, substring string) bool {
	if len(substring) > len(original) {
		return false
	}
	str := string(original[0:len(substring)])
	return str == substring
}

func endWith(original, substring string) bool {
	if len(substring) > len(original) {
		return false
	}
	str := string(original[len(original)-len(substring):])
	return str == substring
}

func getFileName(filepath string) string {
	if *rename != "" {
		return *rename
	}
	index := strings.LastIndex(filepath, "/")
	if index == -1 {
		return filepath
	}
	return filepath[index+1:]
}

func getFolderName(filepath string) string {
	var result string
	if endWith(filepath, "/") {
		pos := strings.LastIndex(string(filepath[:len(filepath)-1]), "/")
		result = filepath[pos+1 : len(filepath)-1]
	} else {
		pos := strings.LastIndex(filepath, "/")
		result = filepath[pos+1:]
	}
	return result
}

func getPathInsideFolder(path, folder string) string {
	pos := strings.Index(path, folder)
	var result string
	if pos != -1 {
		result = string(path[pos-1:])
	}
	return result
}
{'fraction_non_alphanumeric': 0.1607706885660139, 'fraction_numerical': 0.006317119393556538, 'mean_word_length': 4.243377483443709, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5536457', 'n_tokens_mistral': 1166, 'n_tokens_neox': 1111, 'n_words': 237}