hay-kot / scaffold

A cookie cutter alternative with in-project scaffolding for generating components, controllers, or other common code patterns.
https://hay-kot.github.io/scaffold/
MIT License
51 stars 5 forks source link

feat: Add mode to inject templates after marker #139

Closed anthonychung14 closed 3 months ago

anthonychung14 commented 3 months ago

Closes https://github.com/hay-kot/scaffold/issues/127

Adds a mode param that lets user inject code after the marker.

This has proven to be useful if we want to use a more understandable marker such as

at: "bob := map[string]Foo{"

rather than something more brittle/less understandable than

at: "&SomeRandomItemInList{}"

Also, in order to have tests pass on my machine, I had to change go.mod per instructions here https://github.com/golang/go/issues/65568#issuecomment-1954876836

I can remove this, but I'm not super proficient at Go, so if there's another workaround, happy to remove this commit

anthonychung14 commented 3 months ago

@hay-kot - wdyt? would like to use this. think it works given the test case.

hay-kot commented 3 months ago

This looks good! I want to refactor some of those tests (not your code, my code) before I merge so give me a couple days and we'll get this in!