@@ -14,22 +14,22 @@ var tagCategories = []string{"json", "yaml"}
1414// WithTags allows you to specify custom tag categories to check for.
1515// It can be used to override the default "json" and "yaml" tags.
1616// The tags are checked in the order they are provided.
17- func WithTags (tags ... string ) ToMapOptions {
17+ func WithTags (tags ... string ) ToMapOption {
1818 return func (h * handler ) {
1919 h .tags = tags
2020 }
2121}
2222
2323// WithAllowNoTags allows you to specify whether to allow fields without tags.
2424// If used, fields without tags will be included in the output map.
25- func WithAllowNoTags () ToMapOptions {
25+ func WithAllowNoTags () ToMapOption {
2626 return func (h * handler ) {
2727 h .allowNoTags = true
2828 }
2929}
3030
31- // ToMapOptions is a function that modifies the handler.
32- type ToMapOptions func (* handler )
31+ // ToMapOption is a function that modifies the handler.
32+ type ToMapOption func (* handler )
3333
3434// handler is a struct that contains the options for the ToMap function.
3535// It contains a list of tags to check for and a flag to allow fields
@@ -53,7 +53,7 @@ type tagWrapper struct {
5353// It also initializes the allowNoTags flag to false.
5454// It can be modified using the ToMapOptions functions.
5555// It returns a pointer to the handler.
56- func newHandler (opts ... ToMapOptions ) * handler {
56+ func newHandler (opts ... ToMapOption ) * handler {
5757 h := & handler {
5858 tags : tagCategories ,
5959 allowNoTags : false ,
@@ -76,7 +76,7 @@ func newHandler(opts ...ToMapOptions) *handler {
7676//
7777// If the input is nil, it returns nil.
7878// If the input is not a struct or map, it returns an error.
79- func ToMap (obj any , opts ... ToMapOptions ) (map [string ]any , error ) {
79+ func ToMap (obj any , opts ... ToMapOption ) (map [string ]any , error ) {
8080 handler := newHandler (opts ... )
8181
8282 if obj == nil {
0 commit comments