Skip to content

Sort an array #147

@drpaneas

Description

@drpaneas

Dev story
Write a function/method that sorts an array in a similar way with the Linux command sort

Example:

sortedArray := sort(unsortedArray)

Acceptance Criteria

Hints:

  • Writing a unit test for filesystem checking is not trivial. You should NOT create a real file on the system, because then your test will depend on the I/O of the file system itself. The last resort is mocking the filesystem. There are quite a few powerful libraries like spf13/afero for this purpose (mocking of a filesystem). These packages will create temporary files in the background and clean up afterward.
  • As an exercise, try to write the test first. Let it fail. Then try to fix it, by writing the actual implementation of the function.

Extra Help:

NOTICE: If you are unable to mock this test, in worst case scenario, create a folder internal/utils/testdata and put actual files you can use for your test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions