Skip to content

Implement work with slices  #1

@awskii

Description

@awskii

For now, we can't pass slice of pointers to struct to parse data to, instead of that we should pass one pointer to struct at itreration.

Current state:

var dest []*MyStructure
for i := 0; i < len(dest) && i < len(lines); i++ {
  if err := hunkee.ParseLine(lines[i], dest[i]); err != nil {
    fmt.Println(err)
  }
}

With ability to parse lines into slice becomes next:

var dest []*MyStructure
// dest len will be extended as much as needed to
// parse all presented lines into
if err := hunkee.Parse(lines, dest); err != nil {
  fmt.Println(err)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions