14 Commits

Author SHA1 Message Date
guy176251 1d19dbcac7 changed read only url back 2026-05-28 12:56:09 -05:00
guy176251 52bdbec89a added request headers to debug log 2026-05-28 06:46:57 -05:00
guy176251 57129fcb83 changed read only url 2026-05-28 06:13:09 -05:00
guy176251 eda8018886 changed repo 2026-05-27 18:07:30 -05:00
guy176251 8ac819cfc5 removed v2 2026-05-27 18:00:56 -05:00
guy176251 bd1544ad10 Revert "added v2 package"
This reverts commit 88d73f0f2e.
2026-05-27 17:59:11 -05:00
guy176251 8599140aca Revert "removed v2 from v1 module"
This reverts commit f6ffc7064a.
2026-05-27 17:59:09 -05:00
guy176251 f6ffc7064a removed v2 from v1 module 2026-05-27 14:25:57 -05:00
guy176251 88d73f0f2e added v2 package 2026-05-27 14:24:26 -05:00
guy176251 21d32239d3 Revert "changed module path"
This reverts commit 2608f0e3f0.
2026-05-27 14:10:50 -05:00
guy176251 2608f0e3f0 changed module path 2026-05-27 13:24:37 -05:00
guy176251 c7b874d2b4 turned off pipeline tests 2026-05-27 13:01:49 -05:00
guy176251 d7fc369cbd changed old repo references 2026-05-27 12:58:06 -05:00
guy176251 f44802eeee changed module path 2026-05-27 12:38:05 -05:00
11 changed files with 19 additions and 19 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
name: tests
on: [push, pull_request]
#on: [push, pull_request]
jobs:
test:
+1 -1
View File
@@ -1,4 +1,4 @@
ROOT_PKG ?= "github.com/vartanbeno/go-reddit"
ROOT_PKG ?= "git.the-red-comet.org/guy176251/go-reddit"
LIST_PKG := $(shell go list $(ROOT_PKG)/...)
# Tests
+7 -7
View File
@@ -6,9 +6,9 @@
<div id='badges' align='center'>
[![Actions Status](https://github.com/vartanbeno/go-reddit/workflows/tests/badge.svg)](https://github.com/vartanbeno/go-reddit/actions)
[![Go Report Card](https://goreportcard.com/badge/github.com/vartanbeno/go-reddit)](https://goreportcard.com/report/github.com/vartanbeno/go-reddit)
[![PkgGoDev](https://pkg.go.dev/badge/github.com/vartanbeno/go-reddit/v2/reddit)](https://pkg.go.dev/github.com/vartanbeno/go-reddit/v2/reddit)
[![Actions Status](https://git.the-red-comet.org/guy176251/go-reddit/workflows/tests/badge.svg)](https://git.the-red-comet.org/guy176251/go-reddit/actions)
[![Go Report Card](https://goreportcard.com/badge/git.the-red-comet.org/guy176251/go-reddit)](https://goreportcard.com/report/git.the-red-comet.org/guy176251/go-reddit)
[![PkgGoDev](https://pkg.go.dev/badge/git.the-red-comet.org/guy176251/reddit-go/reddit)](https://pkg.go.dev/git.the-red-comet.org/guy176251/reddit-go/reddit)
</div>
@@ -24,16 +24,16 @@ You can view Reddit's official API documentation [here](https://www.reddit.com/d
## Install
To get a specific version from the list of [versions](https://github.com/vartanbeno/go-reddit/releases):
To get a specific version from the list of [versions](https://git.the-red-comet.org/guy176251/go-reddit/releases):
```sh
go get github.com/vartanbeno/go-reddit/v2@vX.Y.Z
go get git.the-red-comet.org/guy176251/reddit-go@vX.Y.Z
```
Or for the latest version:
```sh
go get github.com/vartanbeno/go-reddit/v2
go get git.the-red-comet.org/guy176251/reddit-go
```
The repository structure for managing multiple major versions follows the one outlined [here](https://github.com/go-modules-by-example/index/tree/master/016_major_version_repo_strategy#major-branch-strategy).
@@ -45,7 +45,7 @@ Make sure to have a Reddit app with a valid client id and secret. [Here](https:/
```go
package main
import "github.com/vartanbeno/go-reddit/v2/reddit"
import "git.the-red-comet.org/guy176251/reddit-go/reddit"
func main() {
credentials := reddit.Credentials{ID: "id", Secret: "secret", Username: "username", Password: "password"}
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"log"
"net/http"
"github.com/vartanbeno/go-reddit/v2/reddit"
"git.the-red-comet.org/guy176251/reddit-go/reddit"
)
var ctx = context.Background()
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"fmt"
"log"
"github.com/vartanbeno/go-reddit/v2/reddit"
"git.the-red-comet.org/guy176251/reddit-go/reddit"
)
var ctx = context.Background()
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"fmt"
"log"
"github.com/vartanbeno/go-reddit/v2/reddit"
"git.the-red-comet.org/guy176251/reddit-go/reddit"
)
var ctx = context.Background()
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"log/slog"
"os"
"github.com/vartanbeno/go-reddit/v2/reddit"
"git.the-red-comet.org/guy176251/reddit-go/reddit"
)
type Post struct {
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"syscall"
"time"
"github.com/vartanbeno/go-reddit/v2/reddit"
"git.the-red-comet.org/guy176251/reddit-go/reddit"
)
var ctx = context.Background()
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"fmt"
"log"
"github.com/vartanbeno/go-reddit/v2/reddit"
"git.the-red-comet.org/guy176251/reddit-go/reddit"
)
var ctx = context.Background()
+2 -2
View File
@@ -1,8 +1,9 @@
module github.com/vartanbeno/go-reddit/v2
module git.the-red-comet.org/guy176251/reddit-go
go 1.24.0
require (
github.com/andybalholm/brotli v1.2.0
github.com/enetx/surf v1.0.173
github.com/google/go-querystring v1.0.0
github.com/stretchr/testify v1.11.1
@@ -11,7 +12,6 @@ require (
)
require (
github.com/andybalholm/brotli v1.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/enetx/g v1.0.202 // indirect
github.com/enetx/http v1.0.24 // indirect
+2 -2
View File
@@ -21,7 +21,7 @@ import (
)
const (
libraryName = "github.com/vartanbeno/go-reddit"
libraryName = "git.the-red-comet.org/guy176251/go-reddit"
libraryVersion = "2.0.0"
defaultBaseURL = "https://oauth.reddit.com"
@@ -349,7 +349,7 @@ func parseRate(r *http.Response) Rate {
// pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface,
// the raw response will be written to v, without attempting to decode it.
func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*Response, error) {
slog.Debug("Making API request to reddit", "url", req.URL.String(), "method", req.Method)
slog.Debug("Making API request to reddit", "url", req.URL.String(), "method", req.Method, "headers", req.Header)
if err := c.checkRateLimitBeforeDo(req); err != nil {
return &Response{
Response: err.Response,