From 9ab4bf49ad1f8ba99df183ded8c1d6f27a094fa3 Mon Sep 17 00:00:00 2001 From: Jener Rasmussen Date: Wed, 4 Dec 2024 14:31:24 +0100 Subject: [PATCH] Remove redundant struct definition --- pkg/tidydns/tidydns.go | 10 +++++----- pkg/tidydns/types.go | 28 ++++++++++------------------ 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/pkg/tidydns/tidydns.go b/pkg/tidydns/tidydns.go index 4d386a4..9842a5f 100644 --- a/pkg/tidydns/tidydns.go +++ b/pkg/tidydns/tidydns.go @@ -81,11 +81,11 @@ type UserInfo struct { } type UserInfoGroup struct { - GroupName string - Name string - Notes *string - Id int - Description *string + GroupName string `json:"groupname"` + Name string `json:"name"` + Notes *string `json:"notes,omitempty"` + Id int `json:"id"` + Description *string `json:"description,omitempty"` } type UserID int diff --git a/pkg/tidydns/types.go b/pkg/tidydns/types.go index b855371..c4432c7 100644 --- a/pkg/tidydns/types.go +++ b/pkg/tidydns/types.go @@ -63,22 +63,14 @@ type userCreate struct { } type userRead struct { - ModifiedBy string `json:"modified_by"` - Description string `json:"description"` - ModifiedDate string `json:"modified_date"` - Username string `json:"username"` - AuthGroup string `json:"auth_group"` - Name string `json:"name"` - Epassword string `json:"epassword"` - PasswdChangedDate string `json:"passwd_changed_date"` - Id int `json:"id"` - Groups []userGroup `json:"groups"` -} - -type userGroup struct { - GroupName string `json:"groupname"` - Name string `json:"name"` - Notes *string `json:"notes,omitempty"` - Id int `json:"id"` - Description *string `json:"description,omitempty"` + ModifiedBy string `json:"modified_by"` + Description string `json:"description"` + ModifiedDate string `json:"modified_date"` + Username string `json:"username"` + AuthGroup string `json:"auth_group"` + Name string `json:"name"` + Epassword string `json:"epassword"` + PasswdChangedDate string `json:"passwd_changed_date"` + Id int `json:"id"` + Groups []UserInfoGroup `json:"groups"` }