Skip to content

Commit

Permalink
re: restructure packages
Browse files Browse the repository at this point in the history
  • Loading branch information
cybardev committed Mar 1, 2024
1 parent ba3ec88 commit d637db7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions yt.go → cmd/ytgo/yt.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"fmt"
"log"
"strings"

"github.com/cybardev/ytgo/internal/app/ytgo"
)

func main() {
Expand All @@ -30,12 +32,12 @@ func main() {
}

// play media from YT or display URL
var v VID
var v ytgo.VID
var err error
if f {
v, err = VIDfromURL(query)
v, err = ytgo.VIDfromURL(query)
} else {
v, err = nthVideo(query, n)
v, err = ytgo.NthVideo(query, n)
}
if err != nil {
log.Fatalln(err)
Expand Down
4 changes: 2 additions & 2 deletions search.go → internal/app/ytgo/search.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package ytgo

import (
"errors"
Expand Down Expand Up @@ -46,7 +46,7 @@ func getVideos(query string) ([]VID, error) {
return vids, nil
}

func nthVideo(query string, n int) (VID, error) {
func NthVideo(query string, n int) (VID, error) {
vids, err := getVideos(query)
if err != nil {
return "", err
Expand Down
2 changes: 1 addition & 1 deletion vid.go → internal/app/ytgo/vid.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package ytgo

import (
"net/url"
Expand Down

0 comments on commit d637db7

Please sign in to comment.