Skip to content

Instantly share code, notes, and snippets.

View clementlecorre's full-sized avatar
🤖
hhuhhh

Clément clementlecorre

🤖
hhuhhh
View GitHub Profile
@lelandbatey
lelandbatey / assign_struct_field_by_tag_name.go
Last active February 28, 2025 19:53
Golang reflection; assign to struct field by tag name
package main
import (
"fmt"
"reflect"
"strings"
)
// The goal: allow assignment to a go struct field based on the name that field
// is tagged with (specifically it's json-tagged name).