# Making code-generation in Go more powerful with generics

DevFeed: [Making code-generation in Go more powerful with generics](<https://devfeed.tech/articles/making-code-generation-in-go-more-powerful-with-generics-11720.md>)

Original publisher: [Read original article](<https://incident.io/blog/code-generation>)

Author: Isaac Seymour

Published: 2022-10-20T00:00:00Z

Content type: article

Language: en

Sources: [The incident.io Blog](<https://devfeed.tech/sources/the-incident-io-blog.md>)

Topics: [Go Language](<https://devfeed.tech/topics/go-language.md>), [Code generation](<https://devfeed.tech/topics/code-generation.md>), [Object-relational mapping](<https://devfeed.tech/topics/orm.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [code-generation](<https://devfeed.tech/tags/code-generation.md>), [go](<https://devfeed.tech/tags/go.md>), [incident](<https://devfeed.tech/tags/incident.md>), [incident-channel](<https://devfeed.tech/tags/incident-channel.md>), [incident-management](<https://devfeed.tech/tags/incident-management.md>), [incident-response](<https://devfeed.tech/tags/incident-response.md>), [orm](<https://devfeed.tech/tags/orm.md>), [outage](<https://devfeed.tech/tags/outage.md>), [post-mortem](<https://devfeed.tech/tags/post-mortem.md>), [programming](<https://devfeed.tech/tags/programming.md>), [slack-incident](<https://devfeed.tech/tags/slack-incident.md>)

## AI overview

The article explains how incident.io combines Go generics with code generation to create safer, more readable developer workflows. It focuses on partial structs, which represent subsets of larger structs and help distinguish intentionally set fields from Go zero values when updating data, including database records managed through Gorm.

## Source excerpt

Go 1.18 added generics to the language a few months ago. Here's how we've combined generics with code generation to make our code safer and easier to read and write.