Skip to content

Commit

Permalink
Rename variable to avoid predeclared identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
semperos committed Oct 11, 2024
1 parent be72c6e commit 659727f
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions time.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ func VFTimeDate(_ *goal.Context, args []goal.V) goal.V {
month := time.January
day := 1
hour := 0
min := 0
minute := 0
sec := 0
nsec := 0
loc := time.UTC
t := time.Date(year, month, day, hour, min, sec, nsec, loc)
t := time.Date(year, month, day, hour, minute, sec, nsec, loc)
return goal.NewV(&Time{Time: &t})
}
return panicType("time.date year", "year", yearV)
Expand All @@ -108,11 +108,11 @@ func VFTimeDate(_ *goal.Context, args []goal.V) goal.V {
month := time.Month(monthV.I())
day := 1
hour := 0
min := 0
minute := 0
sec := 0
nsec := 0
loc := time.UTC
t := time.Date(year, month, day, hour, min, sec, nsec, loc)
t := time.Date(year, month, day, hour, minute, sec, nsec, loc)
return goal.NewV(&Time{Time: &t})
case triadic:
yearV := args[2]
Expand All @@ -131,11 +131,11 @@ func VFTimeDate(_ *goal.Context, args []goal.V) goal.V {
month := time.Month(monthV.I())
day := int(dayV.I())
hour := 0
min := 0
minute := 0
sec := 0
nsec := 0
loc := time.UTC
t := time.Date(year, month, day, hour, min, sec, nsec, loc)
t := time.Date(year, month, day, hour, minute, sec, nsec, loc)
return goal.NewV(&Time{Time: &t})
case tesseradic:
yearV := args[3]
Expand All @@ -158,11 +158,11 @@ func VFTimeDate(_ *goal.Context, args []goal.V) goal.V {
month := time.Month(monthV.I())
day := int(dayV.I())
hour := int(hourV.I())
min := 0
minute := 0
sec := 0
nsec := 0
loc := time.UTC
t := time.Date(year, month, day, hour, min, sec, nsec, loc)
t := time.Date(year, month, day, hour, minute, sec, nsec, loc)
return goal.NewV(&Time{Time: &t})
case pentadic:
yearV := args[4]
Expand All @@ -189,11 +189,11 @@ func VFTimeDate(_ *goal.Context, args []goal.V) goal.V {
month := time.Month(monthV.I())
day := int(dayV.I())
hour := int(hourV.I())
min := int(minV.I())
minute := int(minV.I())
sec := 0
nsec := 0
loc := time.UTC
t := time.Date(year, month, day, hour, min, sec, nsec, loc)
t := time.Date(year, month, day, hour, minute, sec, nsec, loc)
return goal.NewV(&Time{Time: &t})
case hexadic:
yearV := args[5]
Expand Down Expand Up @@ -224,11 +224,11 @@ func VFTimeDate(_ *goal.Context, args []goal.V) goal.V {
month := time.Month(monthV.I())
day := int(dayV.I())
hour := int(hourV.I())
min := int(minV.I())
minute := int(minV.I())
sec := int(secV.I())
nsec := 0
loc := time.UTC
t := time.Date(year, month, day, hour, min, sec, nsec, loc)
t := time.Date(year, month, day, hour, minute, sec, nsec, loc)
return goal.NewV(&Time{Time: &t})
case heptadic:
yearV := args[6]
Expand Down Expand Up @@ -263,11 +263,11 @@ func VFTimeDate(_ *goal.Context, args []goal.V) goal.V {
month := time.Month(monthV.I())
day := int(dayV.I())
hour := int(hourV.I())
min := int(minV.I())
minute := int(minV.I())
sec := int(secV.I())
nsec := int(nsecV.I())
loc := time.UTC
t := time.Date(year, month, day, hour, min, sec, nsec, loc)
t := time.Date(year, month, day, hour, minute, sec, nsec, loc)
return goal.NewV(&Time{Time: &t})
case octadic:
yearV := args[7]
Expand Down Expand Up @@ -306,11 +306,11 @@ func VFTimeDate(_ *goal.Context, args []goal.V) goal.V {
month := time.Month(monthV.I())
day := int(dayV.I())
hour := int(hourV.I())
min := int(minV.I())
minute := int(minV.I())
sec := int(secV.I())
nsec := int(nsecV.I())
loc := locV.Location
t := time.Date(year, month, day, hour, min, sec, nsec, loc)
t := time.Date(year, month, day, hour, minute, sec, nsec, loc)
return goal.NewV(&Time{Time: &t})
default:
return goal.Panicf("time.date : too many arguments (%d), expects 1 to 8 arguments", len(args))
Expand Down

0 comments on commit 659727f

Please sign in to comment.