Skip to content
This repository was archived by the owner on Apr 9, 2020. It is now read-only.

Commit 42da6d9

Browse files
committed
🔀 Merge branch 'develop'
2 parents a404b39 + 05932ce commit 42da6d9

File tree

5 files changed

+22
-13
lines changed

5 files changed

+22
-13
lines changed

.gitlab-ci.yml

+1-10
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@ image: golang:alpine
22

33
stages:
44
- test
5-
- review
65

76
before_script:
87
- apk add --no-cache git build-base bash make
98
- mkdir -p /go/src/gitlab.com/$CI_PROJECT_NAMESPACE /go/src/_/builds
109
- cp -r $CI_PROJECT_DIR /go/src/gitlab.com/$CI_PROJECT_PATH
1110
- ln -s /go/src/gitlab.com/$CI_PROJECT_NAMESPACE /go/src/_/builds/$CI_PROJECT_NAMESPACE
12-
- go get github.com/golangci/golangci-lint/cmd/golangci-lint
13-
- go install github.com/golangci/golangci-lint/cmd/golangci-lint
1411
- make dep
1512

1613
unit_tests:
@@ -22,10 +19,4 @@ code_coverage:
2219
stage: test
2320
script:
2421
- make coverage
25-
coverage: '/^coverage:\s(\d+(?:\.\d+)?%)/'
26-
27-
lint_code:
28-
stage: review
29-
script:
30-
- make lint
31-
allow_failure: true
22+
coverage: '/^coverage:\s(\d+(?:\.\d+)?%)/'

fetch_embed_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func TestFetchEmbed(t *testing.T) {
4646
t.Run(url, func(t *testing.T) {
4747
provider := findProvider(url)
4848
if provider == nil {
49-
provider = &Provider{Endpoints: []Endpoint{Endpoint{}}}
49+
provider = &Provider{Endpoints: []Endpoint{{}}}
5050
}
5151

5252
_, err := fetchEmbed(url, provider, nil)

oembed.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package oembed add utils for supporting oEmbed fetching data,
12
package oembed
23

34
import "golang.org/x/xerrors"

patrons.go

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package oembed
2+
3+
import (
4+
"log"
5+
"sort"
6+
"strings"
7+
)
8+
9+
func init() {
10+
patrons := []string{"Aurielb", "MoD21k", "Yami Odymel"}
11+
sort.Strings(patrons)
12+
log.Print(
13+
"Support toby3d on Patreon: https://patreon.com/bePatron?c=243288", "\n",
14+
"The current version of oembed is sponsored by: ",
15+
strings.Join(patrons[:len(patrons)-1], ", "), " and ", patrons[len(patrons)-1],
16+
)
17+
}

types.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ type (
99
Endpoints []Endpoint `json:"endpoints"`
1010
}
1111

12-
// Provider represent a single endpoint of Provider
12+
// Endpoint represent a single endpoint of Provider
1313
Endpoint struct {
1414
Schemes []string `json:"schemes,omitempty"`
1515
URL string `json:"url"`
1616
Discovery bool `json:"discovery,omitempty"`
1717
Formats []string `json:"formats,omitempty"`
1818
}
1919

20-
// Response can specify a resource type, such as photo or video.
20+
// OEmbed can specify a resource type, such as photo or video.
2121
// Each type has specific parameters associated with it.
2222
OEmbed struct {
2323
// The resource type.

0 commit comments

Comments
 (0)