@@ -14,7 +14,7 @@ import (
1414 logrus "github.com/sirupsen/logrus"
1515)
1616
17- const gitlabSiginPath = "/users/sign_in"
17+ const gitlabSignInPath = "/users/sign_in"
1818const gitlabPersonalAccessTokenURLPath = "/profile/personal_access_tokens"
1919
2020// GitLabTokenRequest describes the token Request
@@ -38,7 +38,7 @@ func CreateToken(gr GitLabTokenRequest) (string, error) {
3838 Jar : jar ,
3939 }
4040
41- loginURL , err := url .Parse (gr .URL + gitlabSiginPath )
41+ loginURL , err := url .Parse (gr .URL + gitlabSignInPath )
4242
4343 if err != nil {
4444 return "" , err
@@ -66,7 +66,7 @@ func CreateToken(gr GitLabTokenRequest) (string, error) {
6666 if err != nil {
6767 return "" , err
6868 }
69- token , err := findPersonaAccessToken (responseBody )
69+ token , err := findPersonalAccessToken (responseBody )
7070 if err != nil {
7171 return "" , err
7272 }
@@ -121,18 +121,18 @@ func addExpiry(values url.Values, date string) (url.Values, error) {
121121 }
122122 dateparts := strings .Split (date , "-" )
123123 if len (dateparts ) < 3 {
124- return nil , errors .New ("Date is to short it should be formatted like this 2017-12-03" )
124+ return nil , errors .New ("Date is too short it should be formatted like this 2017-12-03" )
125125 }
126126
127127 if len (dateparts [0 ]) < 4 {
128- return nil , errors .New ("Year is to short" )
128+ return nil , errors .New ("Year is too short" )
129129 }
130130
131131 if len (dateparts [1 ]) < 2 {
132- return nil , errors .New ("Month is to short needs to be with zero digest" )
132+ return nil , errors .New ("Month is too short needs to be with zero digest" )
133133 }
134134 if len (dateparts [2 ]) < 2 {
135- return nil , errors .New ("Day is to short needs to be with zero digest" )
135+ return nil , errors .New ("Day is too short needs to be with zero digest" )
136136 }
137137 values .Add ("personal_access_token[expires_at]" , date )
138138 return values , nil
@@ -154,7 +154,7 @@ func findCSRFToken(htmlBody string) map[string]string {
154154 return m
155155}
156156
157- func findPersonaAccessToken (htmlBody string ) (string , error ) {
157+ func findPersonalAccessToken (htmlBody string ) (string , error ) {
158158 doc := soup .HTMLParse (htmlBody )
159159 found := doc .Find ("input" , "id" , "created-personal-access-token" )
160160 if found .Pointer == nil {
0 commit comments