Skip to content

Reduce complexity when parsing content #14

@ccoVeille

Description

@ccoVeille

The complexity of the code was increased with #13 by the multiple branching if

The parsing of the content could be moved out the main with something like this

contentStr, err := parseContent(flag)
if err != nil {
fmt.Println
os.Exitt(1)
}

// …

func parseContent(flag) string, error {
   if directText != {
      return *directText
   }

   // …
}

Originally posted by @ccoVeille in #13 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersrefactoringIssues or PRs to improving code structure, without changing its external behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions