bazmurphy / immersive-go-course

An immersive, introductory course to backend software engineering using go.
https://systems.codeyourfuture.io/
Creative Commons Zero v1.0 Universal
0 stars 0 forks source link

For Mentor Review | CLI Files | Baz Murphy #2

Open bazmurphy opened 8 months ago

bazmurphy commented 8 months ago

Learners, PR Template

Self checklist

Description

This is my first attempt at Prep project 02 cli-files

Change list

Not applicable (initial commit)

Rationale, briefly

@mentions, #links

bazmurphy commented 8 months ago

Thanks, yes i wasn't sure... I need to understand this cmd/root.go and cmd.Execute() pattern and why it is used, so I will look into it

berkeli commented 8 months ago

Looking good so far, you can look into using other packages to simplify your workflow. Specifically https://github.com/spf13/cobra which is pretty much industry standard, we use it at slack and also k8s kubectl is built using it.

bazmurphy commented 8 months ago

Thank you @berkeli

I have made adjustments based on your feedback


I know I have not yet fulfilled the extensions (stretch goals):

go-ls - tests & extra flags go-cat - multiple filenames


Before I use external helper packages I like to know how to do the fundamentals myself (even if basic) in case I need to understand it elsewhere later down the line

I will bookmark the cobra package you linked and take a look later, it is important since it is used at slack

berkeli commented 8 months ago

It's looking good so far, great job!

bazmurphy commented 7 months ago

had a go to implement most (not all) of the feedback still have to write tests for this... but that is predicated on being very comfortable with dependency injection and interfaces would like some live discussion/help with this if possible

bazmurphy commented 6 months ago

Ok that is enough for now...

Both go-ls and go-cat now have:

This took a long time, but I learned a lot


About TOCTOU I will have to come back to this :hot_face: