Skip to content

Commit

Permalink
ebct
Browse files Browse the repository at this point in the history
  • Loading branch information
HerbertNatal committed Jul 25, 2024
1 parent ec39c0c commit ef29281
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/davecgh/go-spew v1.1.1
github.com/google/uuid v1.3.0
github.com/google/uuid v1.6.0
github.com/stretchr/testify v1.8.0
)

Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
9 changes: 8 additions & 1 deletion sro_rastro.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ebct

import (
"errors"
"os"
"time"
)

Expand All @@ -13,14 +14,20 @@ type TimeStrRastro struct {

// UnmarshalJSON decodifica o JSON para o tipo TimeStr
func (t *TimeStrRastro) UnmarshalJSON(data []byte) error {
os.Setenv("TZ", "America/Sao_Paulo")

str := string(data)
if str == "null" || str == "" {
*t = TimeStrRastro{time.Time{}}
return nil
}
parsedTime, err := time.Parse(`"2006-01-02T15:04:05"`, str)
if err != nil {
return err
parsedTime2, err2 := time.Parse(`"2006-01-02"`, str)
if err2 != nil {
return err2
}
parsedTime = parsedTime2.Add(time.Hour * 3)
}
*t = TimeStrRastro{parsedTime}
return nil
Expand Down
2 changes: 1 addition & 1 deletion token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var client *Client
func init() {

client = NewClient(
"eyJhbGciOiJSUzUxMiJ9.eyJhbWJpZW50ZSI6IlBST0RVQ0FPIiwiaWQiOiJwaG9lbmV4Y2FyZ28iLCJwZmwiOiJQSiIsImNucGoiOiIxMDI1NzYwMjAwMDE4MiIsImFwaSI6WzU2M10sImNhcnRhby1wb3N0YWdlbSI6eyJudW1lcm8iOiIwMDY5Mjk1ODE2IiwiY29udHJhdG8iOiI5OTEyMzUyMTY3IiwiZHIiOjcyLCJhcGkiOlsyNywzNCwzNSwzNiwzNyw0MSw3Niw3OCw4MCw4Myw4Nyw1NjYsNTg3XX0sImlwIjoiMTc5LjEwMS4yMTYuMjE0LCAxOTIuMTY4LjEuMTMyIiwiaWF0IjoxNzIxNzQ2MDM0LCJpc3MiOiJ0b2tlbi1zZXJ2aWNlIiwiZXhwIjoxNzIxODMyNDM0LCJqdGkiOiJjYWQyMTk2OC03MGRmLTRkYjUtOGFhNS0wNWJjMTk1NDFmNGMifQ.yeISSHn_uZsn4lSkFuPjiFuPhFyF_WSpzObGfngR2TEAcyTq99mS-sYgfdyxNV8YPf5hL6Y-FbS0SIeBY7UllntdEGFofyLW7lmGKQIuVybqfjeocGbKL15Cw-c3kbMY8trU5JQcUge_bSVsrjsZzMOBRCmUEPfRD0zxYyJE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