diff --git a/init.go b/init.go index 01d0cf2..9260458 100644 --- a/init.go +++ b/init.go @@ -420,7 +420,7 @@ func (h *header) WithText(v string) *header { // Returns: // - The updated `header` instance with the `Type` field set to the provided value. func (h *header) WithType(v string) *header { - h.Type = v + h.typez = v return h } @@ -1202,7 +1202,7 @@ func (h *header) Respond() map[string]interface{} { m["text"] = h.text } if h.IsTypePresent() { - m["type"] = h.Type + m["type"] = h.typez } if h.IsDescriptionPresent() { m["description"] = h.description @@ -1273,7 +1273,7 @@ func Parse(json string) (w *wrapper, err error) { header.text = value } if value, exists := values["Type"].(string); exists { - header.Type = value + header.typez = value } if value, exists := values["description"].(string); exists { header.description = value diff --git a/types.go b/types.go index 6edc07f..8239381 100644 --- a/types.go +++ b/types.go @@ -73,7 +73,7 @@ type meta struct { type header struct { code int // Application-specific status code. text string // Human-readable status text. - Type string // Type or category of the status, e.g., "info", "error". + typez string // Type or category of the status, e.g., "info", "error". description string // Detailed description of the status. } diff --git a/wrap.go b/wrap.go index 00c91ee..a8c24b0 100644 --- a/wrap.go +++ b/wrap.go @@ -714,7 +714,7 @@ func (h *header) IsTextPresent() bool { // - `true` if the `Type` field is non-empty. // - `false` if the `Type` field is either not present (nil) or empty. func (h *header) IsTypePresent() bool { - return h.Available() && unify4g.IsNotEmpty(h.Type) + return h.Available() && unify4g.IsNotEmpty(h.typez) } // IsDescriptionPresent checks if the `description` field in the `header` instance is present and not empty. @@ -771,7 +771,7 @@ func (h *header) TypeN() string { if !h.Available() { return "" } - return h.Type + return h.typez } // Description retrieves the description value from the `header` instance.