TL;DR : Sructs in Go enables us to define custom types , yes I said type*S* (in plural!), upon which is passed type checking on build (compile-time) can instantiate "object-like" blueprint of data : hereby I mentioned "object-like" as we going to compared "non-comparable" with JavaScript objects mocking struct-like behaviour, whilst utilising a small extendible utility called – _is I've recently written for this purpose (the later example) :
In Golang :
TIP : refer to structs_factory.go on REPLIT IDE in File Explorer
Meanwhile in JavaScript :
TIP : refer to structs_factory.js on REPLIT IDE in File Explorer
Top comments (1)
Upvoted for 6.1 ed. which included a code example of "embbeded" (optionally anonymous) structs
Stay tuned for more !