<commit_before>// Package gonuts implements the exercises found in An Introduction to Programming in Go.
// See https://www.golang-book.com
package gonuts

import "fmt"

// FizzBuzz returns the string "Fizz" for multiples of 3,
// "Buzz" for multiples of 5 and "FizzBuzz" for numbers that satisfy both conditions.
// If none of the above apply, the current number, formatted as a string, will be returned.
func FizzBuzz(i int) string {

	result := ""
	if i%3 == 0 || i%5 == 0 {
		if i%3 == 0 {
			result += fmt.Sprintf("Fizz")
		}
		if i%5 == 0 {
			result += fmt.Sprintf("Buzz")
		}
	} else {
		result += fmt.Sprintf("%d", i)
	}

	return result
}
<commit_msg>Refactor fizzbuzz :feelsgood:<commit_after>// Package gonuts implements the exercises found in An Introduction to Programming in Go.
// See https://www.golang-book.com
package gonuts

import "fmt"

// FizzBuzz returns the string "Fizz" for multiples of 3,
// "Buzz" for multiples of 5 and "FizzBuzz" for numbers that satisfy both conditions.
// If none of the above apply, the current number, formatted as a string, will be returned.
func FizzBuzz(i int) string {

	result := ""

	if i%3 == 0 {
		result += fmt.Sprintf("Fizz")
	}

	if i%5 == 0 {
		result += fmt.Sprintf("Buzz")
	}

	if result == "" {
		result += fmt.Sprintf("%d", i)
	}

	return result
}

{'fraction_non_alphanumeric': 0.12927756653992395, 'fraction_numerical': 0.012167300380228136, 'mean_word_length': 3.3866666666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '4456713', 'n_tokens_mistral': 475, 'n_tokens_neox': 433, 'n_words': 166}