elliotchance / orderedmap

🔃 An ordered map in Go with amortized O(1) for Set, Get, Delete and Len.
MIT License
817 stars 62 forks source link

Unable to use orderedmap in struct #38

Closed officialasishkumar closed 3 months ago

officialasishkumar commented 3 months ago

I am trying to use ordered map like this

type Dependencies struct {
    Deps orderedmap.NewOrderedMap[string, Dependency]() `json:"packages" toml:"dependencies,omitempty"`
}

type Dependency struct {
    Name     string `json:"name" toml:"name,omitempty"`
    FullName string `json:"-" toml:"full_name,omitempty"`
    Version  string `json:"-" toml:"version,omitempty"`
    Sum      string `json:"-" toml:"sum,omitempty"`
    LocalFullPath string `json:"manifest_path" toml:"-"`
    Source        `json:"-"`
}

But i am getting an error.

cc: @elliotchance