Skip to content

Commit

Permalink
Ready for v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zakaria-chahboun committed Oct 22, 2022
1 parent aac78e2 commit 7f53d1a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

| normal message example | error handling message example|
|----------------|-------------------------|
| `func CreateLastDatePayBill(date time.Time) (m *Message)` | `func ReportErrUserAccessDenied() (m *MessageError)` |
| func CreateLastDatePayBill(date time.Time) (m *Message) | func ReportErrUserAccessDenied() (m *MessageError) |

- Change the default package name in generated files: from `package messages` to `package tarjem`

### You now can specify the package name:

```go
```sh
# e.g translations
tarjem -package translations
```
32 changes: 16 additions & 16 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,33 +268,33 @@ package main

import (
"time"
"fmt"
"[YOUR-MODULE]/tarjem"

"github.com/zakaria-chahboun/cute"
)

func main() {
// choose a language 🇬🇧
tarjem.SetCurrentLang(tarjem.LangEnglish)

// 🤏
m1 := tarjem.CreateLastDatePayBill(time.Now())
// calling .String() method
cute.Println("String() Method", m1)

// print the main message
m2 := tarjem.CreateLastDatePayBill(time.Now()).Message
cute.Println("Message Field", m2)
// print message
m := tarjem.CreateLastDatePayBill(time.Now())
fmt.Println("Message: ", m.Message)

// error case 🐞
err := tarjem.ReportErrUserAccessDenied()
cute.Check("Report", err)
err := login("@captin_bassam","123456")
if err != nil {
panic(err)
}
}
```

output:

<img src="./screenshot/example.png" alter="example" width=500>
func login(name, pass string) error {
// a way of login 👀
if name == "@captain_majid" && pass == "gooooal"{
return nil
}
return tarjem.ReportErrUserAccessDenied()
}
```

## Other arguments
You will find all other arguments in help:
Expand Down
Binary file removed screenshot/example.png
Binary file not shown.

0 comments on commit 7f53d1a

Please sign in to comment.