mirror of
https://github.com/nkanaev/yarr.git
synced 2025-05-24 00:33:14 +00:00
gofmt
This commit is contained in:
parent
391ce61362
commit
9f376db0f4
@ -1,8 +1,8 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"flag"
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
package crawler
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
||||
const base = "http://example.com"
|
||||
|
@ -1,9 +1,9 @@
|
||||
package opml
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"html"
|
||||
"fmt"
|
||||
"html"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type Folder struct {
|
||||
|
@ -5,27 +5,26 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
|
||||
func TestOPML(t *testing.T) {
|
||||
have := (Folder{
|
||||
Title: "",
|
||||
Feeds: []Feed{
|
||||
Feed{
|
||||
{
|
||||
Title: "title1",
|
||||
FeedUrl: "https://baz.com/feed.xml",
|
||||
SiteUrl: "https://baz.com/",
|
||||
},
|
||||
},
|
||||
Folders: []Folder{
|
||||
Folder{
|
||||
{
|
||||
Title: "sub",
|
||||
Feeds: []Feed{
|
||||
Feed{
|
||||
{
|
||||
Title: "subtitle1",
|
||||
FeedUrl: "https://foo.com/feed.xml",
|
||||
SiteUrl: "https://foo.com/",
|
||||
},
|
||||
Feed{
|
||||
{
|
||||
Title: "&>",
|
||||
FeedUrl: "https://bar.com/feed.xml",
|
||||
SiteUrl: "https://bar.com/",
|
||||
|
@ -6,7 +6,6 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
|
||||
func TestParse(t *testing.T) {
|
||||
have, _ := Parse(strings.NewReader(`
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
@ -27,22 +26,22 @@ func TestParse(t *testing.T) {
|
||||
want := Folder{
|
||||
Title: "",
|
||||
Feeds: []Feed{
|
||||
Feed{
|
||||
{
|
||||
Title: "title1",
|
||||
FeedUrl: "https://baz.com/feed.xml",
|
||||
SiteUrl: "https://baz.com/",
|
||||
},
|
||||
},
|
||||
Folders: []Folder{
|
||||
Folder{
|
||||
{
|
||||
Title: "sub",
|
||||
Feeds: []Feed{
|
||||
Feed{
|
||||
{
|
||||
Title: "subtitle1",
|
||||
FeedUrl: "https://foo.com/feed.xml",
|
||||
SiteUrl: "https://foo.com/",
|
||||
},
|
||||
Feed{
|
||||
{
|
||||
Title: "&>",
|
||||
FeedUrl: "https://bar.com/feed.xml",
|
||||
SiteUrl: "https://bar.com/",
|
||||
|
@ -3,8 +3,8 @@
|
||||
package platform
|
||||
|
||||
import (
|
||||
"github.com/nkanaev/yarr/src/systray"
|
||||
"github.com/nkanaev/yarr/src/server"
|
||||
"github.com/nkanaev/yarr/src/systray"
|
||||
)
|
||||
|
||||
func Start(s *server.Handler) {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package storage
|
||||
|
||||
import (
|
||||
"log"
|
||||
"html"
|
||||
"log"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
|
@ -3,11 +3,11 @@ package storage
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
xhtml "golang.org/x/net/html"
|
||||
"html"
|
||||
"log"
|
||||
"strings"
|
||||
"time"
|
||||
xhtml "golang.org/x/net/html"
|
||||
)
|
||||
|
||||
type ItemStatus int
|
||||
|
@ -17,7 +17,7 @@ var maxVersion = int64(len(migrations))
|
||||
|
||||
func migrate(db *sql.DB) error {
|
||||
var version int64
|
||||
db.QueryRow("pragma user_version").Scan(&version);
|
||||
db.QueryRow("pragma user_version").Scan(&version)
|
||||
|
||||
if version >= maxVersion {
|
||||
return nil
|
||||
|
@ -5,8 +5,8 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/mmcdole/gofeed"
|
||||
"github.com/nkanaev/yarr/src/storage"
|
||||
"github.com/nkanaev/yarr/src/crawler"
|
||||
"github.com/nkanaev/yarr/src/storage"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"net/http"
|
||||
|
@ -3,8 +3,8 @@ package worker
|
||||
import (
|
||||
"github.com/nkanaev/yarr/src/storage"
|
||||
"log"
|
||||
"sync/atomic"
|
||||
"runtime"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user