Skip to content

Commit

Permalink
Refactor code.
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulla-ashurov committed Jun 19, 2023
1 parent 0ac0fb2 commit a3410a1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions tests/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,4 @@ var (

var DIDStructure = "did:%s:%s:%s"

var (
HashTag = "\u0023"
Space = "\u0020"
)
var HashTag = "\u0023"
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ var _ = DescribeTable("Positive: Get Collection of Resources with resourceVersio
DidURL: fmt.Sprintf(
"http://localhost:8080/1.0/identifiers/%s?resourceVersionTime=%s&resourceMetadata=true",
testconstants.UUIDStyleTestnetDid,
"2023-01-25"+url.PathEscape(testconstants.Space)+"12:08:40",
url.QueryEscape("2023-01-25 12:08:40"),
),
ResolutionType: testconstants.DefaultResolutionType,
ExpectedJSONPath: "../../../testdata/query/resource_version_time/resource.json",
Expand Down
4 changes: 2 additions & 2 deletions utils/parse_time.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ func ParseFromStringTimeToGoTime(timeString string) (time.Time, error) {
return time.Time{}, nil
}

t, err := parseDateString(timeString)
t, err := parseTimeString(timeString)
if err == nil {
return t, nil
}

return time.Time{}, err
}

func parseDateString(timeString string) (time.Time, error) {
func parseTimeString(timeString string) (time.Time, error) {
formats := []string{
time.Layout,
time.ANSIC,
Expand Down

0 comments on commit a3410a1

Please sign in to comment.