Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort an array #147

Open
6 tasks
drpaneas opened this issue Nov 2, 2020 · 1 comment
Open
6 tasks

Sort an array #147

drpaneas opened this issue Nov 2, 2020 · 1 comment

Comments

@drpaneas
Copy link
Collaborator

drpaneas commented Nov 2, 2020

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.

@drpaneas drpaneas added this to the Basic Utilities milestone Nov 2, 2020
@zoispag
Copy link
Member

zoispag commented Nov 4, 2020

See "sort" package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants