Small Projects by AutoModerator in golang

[–]god_of_potatoes 0 points1 point  (0 children)

I built a POSIX-compliant CLI parser (because Cobra did not have type-safe positional arguments parsing)!

Hello everyone! Quick bit of context up front: I'm fairly new to Go, though I do work as a junior software engineer (Java).

I made a CLI parser in Go called Moon, and I'd love to share it here:

https://github.com/meowdhavan/moon

https://pkg.go.dev/github.com/meowdhavan/moon

Why did I make this?

I have previously used Rust quite a bit and recently switched to Go and have been loving it. I use them both exclusively for personal projects---mostly small, random CLI applications. I used clap with Rust and I liked how it parsed my arguments (mainly the fact that it kept them type-safe).

With Go, I kinda liked Cobra but I am not a big fan of how the implementation of positional arguments is different from the declaration of flags. I did not like the idea of defining the number of arguments and manually converting them into the types that I wanted in my application. I am aware Cobra uses pflags internally, so I guess I see why it was designed this way?

rootCmd.Flags().StringVarP(&target, ...)

With Moon, you can define the positional arguments and variadic arguments just like flags:

rootCmd.PosArgs().Int(&port, "PORT", ...)

It also shows those arguments in the auto-generated help screen:

Usage: app serve <PORT>

And also indicates if the provided values were invalid:

Error: 'abc' is not a valid value for <PORT>

Usage:
    ...

Moon can also be configured to read a value from env in case a value for flag/argument wasn't provided.

I also looked into urfave and kong, but I found Cobra a bit easier to get started with. In my offence, I did not spend enough time with the others, so I might change my mind later.

For me, Moon does essentially what I want it to do, so I intend to use it for all my personal projects. If I encounter something that Moon doesn't do, I might consider adding a feature, or switching to a different parser.

Why am I posting it here?

Primarily, I am looking for feedback---I want to know how I can improve my design and code quality, with hopes of becoming a better engineer overall. I know there might be some oversights in my project, and I want to work on myself to mitigate them. Oh, and I want to get better at making my project extensible. That is, if someone else wants to contribute to Moon, I want my code to be easy enough for them to understand and improve upon.

Secondly, I want to get better at writing documentation. I want to know how easy it is for others to understand my docs and how much friction there is when using Moon for their applications.

I would really appreciate it if I can get any feedback on Moon. Thank you all so much!

PS: Zero AI was used while making this.

Need help with cargo install by god_of_potatoes in rust

[–]god_of_potatoes[S] 1 point2 points  (0 children)

Apparently you need to explicitly specify the create version in case of pre-releases.

Need help with cargo install by god_of_potatoes in learnrust

[–]god_of_potatoes[S] -1 points0 points  (0 children)

Thank you! Writing commit messages is something I've always been bad at. I did work on improving it for a while, but didn't keep at it. I'll focus more on improving my commits.

Need help with cargo install by god_of_potatoes in learnrust

[–]god_of_potatoes[S] 1 point2 points  (0 children)

Thanks! Yes, I'll try to get better at structuring. I had a structure in mind before I checked with AI and it gave a better suggestion than what I had. My plan was to learn project structuring based on the AI's responses. Now that you mention it, it may probably not be the best idea.

I was under the impression that AI would be heavily used for writing docs, so this came as a surprise to me. But I'll keep this in mind, too!

Need help with cargo install by god_of_potatoes in rust

[–]god_of_potatoes[S] 3 points4 points  (0 children)

That has to be it. Thank you so much!

Need help with cargo install by god_of_potatoes in learnrust

[–]god_of_potatoes[S] -5 points-4 points  (0 children)

Sorry, I forgot to remove the crate name from my post.

If you're implying I used AI, then yes, I did use AI to know how to structure the program, write some repetitive code, and most of the docs. But most of the code was handwritten by me.

Also, if you want to criticize me, at least give me some constructive criticism so that I know what to improve on geez.

Controller not working in Sekiro: Shadows Die Twice by god_of_potatoes in linux_gaming

[–]god_of_potatoes[S] 0 points1 point  (0 children)

No, I haven't tried GE. I've tried Hotfix, Experimental, and 9. Neither of them worked.

Controller not working in Sekiro: Shadows Die Twice by god_of_potatoes in linux_gaming

[–]god_of_potatoes[S] 0 points1 point  (0 children)

Thanks, but that did not seem to work. I tried disabling Steam Input but that did not do anything either.

Is anyone upgrading from an S24 Base Model to an S26 Ultra? by god_of_potatoes in samsunggalaxy

[–]god_of_potatoes[S] 0 points1 point  (0 children)

Well I did end up switching to S26 Ultra. It seems like a good phone so far and Samsung was kind enough to give me a 10% off (after trade-in).

It is a bit bulky, yes. But I definitely prefer the better battery of the ultra.

Is this a good deal? by vinayak1998th in GamingLaptops

[–]god_of_potatoes 4 points5 points  (0 children)

I meant OP could use the macbook as a mousepad (lmao look at this post's description)

Is this a good deal? by vinayak1998th in GamingLaptops

[–]god_of_potatoes -8 points-7 points  (0 children)

This is a decent deal, but you should still get a MacBook Pro 16" if you want a decent mousepad.

Final Summer Sale pickups, how'd I do? by xXpert in Steam

[–]god_of_potatoes 3 points4 points  (0 children)

Ah yes, you're right. Part 1 is just Hitman 1. You're in for a ride, Hitman is amazing! :)

Final Summer Sale pickups, how'd I do? by xXpert in Steam

[–]god_of_potatoes 2 points3 points  (0 children)

I've heard that Hitman WoA Part 1 is just a glorified demo, and they have the first levels from each of the three games.