From 2b3b221baf2f612bd815222fd9790a0fa3d2d841 Mon Sep 17 00:00:00 2001 From: Arya Kiran Date: Wed, 18 Jan 2023 22:36:57 +0530 Subject: [PATCH] workaround to allow lowercase in json while still exporting struct field --- main.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/main.go b/main.go index 5825a39..b2a4126 100644 --- a/main.go +++ b/main.go @@ -12,20 +12,20 @@ import ( ) type Userstruct struct { - Status int - Online int - Total int - Users []Userinfo + Status int `json:"status"` + Online int `json:"online"` + Total int `json:"total"` + Users []Userinfo `json:"users"` } type Userinfo struct { - Name string - FullName string - Loc string - Email string - Desc string - Website string - Capsule string - Online bool + Name string `json:"name"` + FullName string `json:"fullName"` + Loc string `json:"loc"` + Email string `json:"email"` + Desc string `json:"desc"` + Website string `json:"website"` + Capsule string `json:"capsule"` + Online bool `json:"online"` } func Dedup(input string) string {