Closed elbachir-one closed 3 months ago
Got it, I'll pause any further changes for now.
I used continue
to skip processing for any theme wrapper (tw
) that does not have a valid name or does not contain any colors. And skips the current color if it is invalid (hexToRGBA
) function returns an error). This prevents invalid color values from being added to the theme's color list, to make sure that only valid colors are included.
Refactored global vars. Now you have a var shared config.Shared
in root.go
Now you can easily add any other global vars in config/config.go
in the Shared
type and not have them scattered in /cmd
the len(args) > 0
check inside
case len(args) > 0 && strings.HasSuffix(args[0],"#") :
in convert.go
and invert.go
eliminates the panics that are thrown with gowall convert
and gowall invert
without file arguments. Good job on finding that
changed Version = "v0.1.5"
strings.ToLower
makes it so users can user whatever capitalization they want when specifying a theme
selectedTheme, exists := themes[strings.ToLower(theme)]
Improved the ProcessBatchImgs
error handling with using an error channel
. Will heavily refactor error handling everywhere myself in a future update before the next planned feature thats why i dont have any more changes here.
a few other minor changes
list.go
can be omitted since gowall already provides 25 themes hardcoded by default so there is no way allThemes
has a length of 0 if len(allThemes) == 0 {
fmt.Println("No themes available.")
return
}
switch
to if - else
in root.go
:switch {
case versionFlag: fmt.Printf("gowall version: %s\n",config.Version)
default : cmd.Help()
}
to
if versionFlag {
fmt.Printf("gowall version: %s\n", config.Version)
} else {
cmd.Help()
is a step backwards in my opinion, because when you want to insert new functionality you will enter if-else hell.
Thank you for your continuous contributions. This is certainly a learning experience for me and i hope its for you too :)
PS: Also please never create huge PR's with changes in 10+ files.
Wait don't change anymore stuff i will fully review things tomorrow or on Saturday since its an hour past midnight.
I do not like some changes ( the use of the
continue
keyword and the change there) and do you use a different formatter than the default one? it makes it difficult to see your actual changes and just different formatting of code without change.I will continue the discussion tomorrow please do not touch business logic if you could or rearrange stuff , it makes it extremely hard to keep track of so many changes at different places and this PR is absolutely huge