}
func main() {
- var err error
-
flag.Parse()
// generate data
var emojiRE = regexp.MustCompile(`\{Emoji:"([^"]*)"`)
func generate() ([]byte, error) {
- var err error
-
// load gemoji data
res, err := http.Get(gemojiURL)
if err != nil {
// NewLFSMetaObject stores a given populated LFSMetaObject structure in the database
// if it is not already present.
func NewLFSMetaObject(ctx context.Context, repoID int64, p lfs.Pointer) (*LFSMetaObject, error) {
- var err error
-
ctx, committer, err := db.TxContext(ctx)
if err != nil {
return nil, err
testSuccess(3, "reversealphabetically", []int64{4, 3})
testSuccess(3, "default", []int64{3, 4})
- var err error
- _, err = issues_model.GetLabelsByOrgID(db.DefaultContext, 0, "leastissues", db.ListOptions{})
+ _, err := issues_model.GetLabelsByOrgID(db.DefaultContext, 0, "leastissues", db.ListOptions{})
assert.True(t, issues_model.IsErrOrgLabelNotExist(err))
_, err = issues_model.GetLabelsByOrgID(db.DefaultContext, -1, "leastissues", db.ListOptions{})
func TestToUTF8(t *testing.T) {
resetDefaultCharsetsOrder()
- var res string
- var err error
// Note: golang compiler seems so behave differently depending on the current
// locale, so some conversions might behave differently. For that reason, we don't
// depend on particular conversions but in expected behaviors.
- res, err = ToUTF8([]byte{0x41, 0x42, 0x43}, ConvertOpts{})
+ res, err := ToUTF8([]byte{0x41, 0x42, 0x43}, ConvertOpts{})
assert.NoError(t, err)
assert.Equal(t, "ABC", res)
return ast.WalkContinue, nil
}
- var err error
- _, err = w.WriteString(fmt.Sprintf(`<i class="icon %s"></i>`, name))
+ _, err := w.WriteString(fmt.Sprintf(`<i class="icon %s"></i>`, name))
if err != nil {
return ast.WalkStop, err
}
}
}
- var err error
repos, count, err := repo_model.SearchRepository(ctx, opts)
if err != nil {
ctx.JSON(http.StatusInternalServerError, api.SearchError{
IncludeDescription: true,
}
- var err error
repos, count, err := repo_model.SearchRepository(ctx, opts)
if err != nil {
ctx.Error(http.StatusInternalServerError, "SearchRepository", err)
if validCursor {
length := step.LogLength - cursor.Cursor
offset := task.LogIndexes[index]
- var err error
logRows, err := actions.ReadLogs(ctx, task.LogInStorage, task.LogFilename, offset, length)
if err != nil {
ctx.Error(http.StatusInternalServerError, err.Error())
timeFrom = timeUntil.Add(-time.Hour * 168)
}
- var err error
authors, err := activities_model.GetActivityStatsTopAuthors(ctx, ctx.Repo.Repository, timeFrom, 10)
if err != nil {
ctx.ServerError("GetActivityStatsTopAuthors", err)
// this should be impossible; if subTreeEntry exists so should this.
continue
}
- var err error
childEntries, err := subTree.ListEntries()
if err != nil {
return "", nil, err
return GetDefaultTemplateConfig(), nil
}
- var err error
-
treeEntry, err := commit.GetTreeEntryByPath(path)
if err != nil {
return GetDefaultTemplateConfig(), err