int to Roman numerals in Go / Golang
This is some fantastic first Go code!

Great use of anonymous structs for test fixtures. I disagree with @sineemore, these are incredibly idiomatic. Nice job writing tests, as well!

There isn't much to be said for the code itself. It's simple and reads clearly. Perhaps you'd want to document it (go doc is fantastic).

I guess strings.Builder is the idiomatic way to do string concatentation in Go >=1.10. However, this is largely for performance reasons.

var roman strings.Builder
for _, conversion := range conversions {
    for number &gt;= conversion.value {
        roman.WriteString(conversion.digit)
        number -= conversion.value
    }
}
return roman.String()


Your next steps are learning about packaing and naming. I'd suggest that instead of calling the field digit you call it something more descriptive like numeral (conversion.numeral reads better than conversion.digit to me). Perhaps you can also come up with better names for roman and number?

I'd also give the function a better name. And to do so, I'd place it in a package called roman. Then call it FromInt. In this way, you use it like roman.FromInt(42), which reads much better. Package naming is really important in Go and you'll find a lot of the standard libraries follow this pattern of making the package name part of the "sentence" instead of just some extra stuff you have to prepend.

In doing this, I'd also recommend putting your tests in package roman_test so they can't access any private functions or variables. This is convention.