This commit is contained in:
Bwko 2016-11-29 14:00:26 +01:00 коммит произвёл Lunny Xiao
Родитель e95390c6a6
Коммит 95683c278e
5 изменённых файлов: 28 добавлений и 28 удалений

Просмотреть файл

@ -11,10 +11,10 @@ import (
const (
// DefaultURL defines the standard remote URL.
DefaultURL = "https://github.com"
DefaultURL = "https://github.com"
// DefaultAPI defines the standard API URL
DefaultAPI = "https://api.github.com/"
DefaultAPI = "https://api.github.com/"
// DefaultScope defines the standard scope for the remote.
DefaultScope = "user:email,read:org,public_repo"

Просмотреть файл

@ -64,7 +64,7 @@ func ParseRequest(r *http.Request, fn SecretFunc) (*Token, error) {
return Parse(token, fn)
}
// and finally we attemt to get the token from
// and finally we attempt to get the token from
// the user session cookie
cookie, err := r.Cookie("user_sess")
if err != nil {

Просмотреть файл

@ -5,9 +5,9 @@ import (
"os"
"time"
"github.com/Sirupsen/logrus"
"github.com/go-gitea/lgtm/store"
"github.com/go-gitea/lgtm/store/migration"
"github.com/Sirupsen/logrus"
"github.com/rubenv/sql-migrate"
"github.com/russross/meddler"

Просмотреть файл

@ -1,36 +1,36 @@
package datastore
import (
"strconv"
"strconv"
"github.com/russross/meddler"
"github.com/russross/meddler"
)
// rebind is a helper function that changes the sql
// bind type from ? to $ for postgres queries.
func rebind(query string) string {
if meddler.Default != meddler.PostgreSQL {
return query
}
if meddler.Default != meddler.PostgreSQL {
return query
}
qb := []byte(query)
rqb := make([]byte, 0, len(qb)+5)
j := 1
qb := []byte(query)
rqb := make([]byte, 0, len(qb)+5)
j := 1
for _, b := range qb {
switch b {
case '?':
rqb = append(rqb, '$')
for _, b := range strconv.Itoa(j) {
rqb = append(rqb, byte(b))
}
j++
case '`':
rqb = append(rqb, ' ')
default:
rqb = append(rqb, b)
}
}
for _, b := range qb {
switch b {
case '?':
rqb = append(rqb, '$')
for _, b := range strconv.Itoa(j) {
rqb = append(rqb, byte(b))
}
j++
case '`':
rqb = append(rqb, ' ')
default:
rqb = append(rqb, b)
}
}
return string(rqb)
return string(rqb)
}

Просмотреть файл

@ -33,7 +33,7 @@ func Template() *template.Template {
}
// marshal is a helper function to render data as JSON
// inside the tempalte.
// inside the template.
func marshal(v interface{}) template.JS {
a, _ := json.Marshal(v)
return template.JS(a)