Post

GoLangGoLang

c
cayrel rings

Posted on 1st May 2024|71 views

0
votes

Golang Array Of Structs

How do you init array of structs in Go?

Answers
P
sreelu 123

Posted on 1st May 2024

Try this example 

Var opts = [] struct

{

shortnm bytes

longnm, help string

needArg bool

}{

{'x', "multiple", "Usage for a", false},

{ shortnm: 'y', 

longnm: "y-option", 

needArg: false, 

help: "Use of y", }, }

 

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo
  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos