This commit is contained in:
Nazar Kanaev 2021-03-19 00:06:48 +00:00
parent 391ce61362
commit 9f376db0f4
24 changed files with 65 additions and 67 deletions

View File

@ -1,8 +1,8 @@
package main
import (
"io/ioutil"
"flag"
"io/ioutil"
"strings"
)

View File

@ -1,8 +1,8 @@
package crawler
import (
"testing"
"reflect"
"testing"
)
const base = "http://example.com"

View File

@ -1,9 +1,9 @@
package opml
import (
"strings"
"html"
"fmt"
"html"
"strings"
)
type Folder struct {

View File

@ -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/",

View File

@ -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/",

View File

@ -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) {

View File

@ -1,8 +1,8 @@
package storage
import (
"log"
"html"
"log"
"net/url"
)

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -3,8 +3,8 @@ package worker
import (
"github.com/nkanaev/yarr/src/storage"
"log"
"sync/atomic"
"runtime"
"sync/atomic"
"time"
)