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

[IMP] Breaking changes in v3 release #26

Open
Delta456 opened this issue Feb 18, 2022 · 1 comment
Open

[IMP] Breaking changes in v3 release #26

Delta456 opened this issue Feb 18, 2022 · 1 comment
Labels
discussion enhancement New feature or request

Comments

@Delta456
Copy link
Owner

Delta456 commented Feb 18, 2022

As I was a newbie who started this project 2 years ago. I had made tons of mistakes by doing an initial release v1.0.0 instead of v0.0.1 as I thought it would be fine but now after gaining experience it seems like I will have to do some major changes.

As a library, one must never print to os.Stderr, instead of doing that one must return an err and let the user handle it plus Color field would be renamed to BoxColor so that it will be consistent to TitleColor and ContentColor:

package main

import "github.com/Delta456/box-cli-maker/v3"
import "log"

func main() {
 Box := box.New(box.Config{Px: 2, Py: 5, Type: "Single", BoxColor: "Cyan"})
 err := Box.Print("Box CLI Maker", "Highly Customized Terminal Box Maker")
   if err != nil {
   log.Fatal(err)
   }
}

Most of the panics for unknown Color types will also be changed probably to err so that the user can handle those too.

Warnings like Unknown Color Terminal Profile, Unknown Alignment provided etc will also be changed to err, though the Box will still be created successfully with default settings.

If there are any more changes needed then I will also add those too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant