go-jobscraper/showstruct/showstruct.go
Martin Donnelly be500fde33 init
2024-04-26 17:13:07 +01:00

19 lines
294 B
Go

package showstruct
import (
"fmt"
"reflect"
)
func Show(item any) {
val := reflect.ValueOf(item)
typ := val.Type()
for i := 0; i < val.NumField(); i++ {
field := val.Field(i)
fieldType := typ.Field(i)
fmt.Printf("Field : %s, Value: %v\n", fieldType.Name, field.Interface())
}
}