diff options
author | Michael Muré <batolettre@gmail.com> | 2018-08-13 15:28:16 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-08-13 15:28:47 +0200 |
commit | df144e727a858ed07e3c9328d91efe052c4781e1 (patch) | |
tree | bfbfeea70f97ab3d4274c8e5add2c3aeeac1423b /graphql/connections/connections.go | |
parent | f2f779c5a8b4efe67317bbffe110a9880c1f529a (diff) | |
download | git-bug-df144e727a858ed07e3c9328d91efe052c4781e1.tar.gz |
fix some linting trouble
Diffstat (limited to 'graphql/connections/connections.go')
-rw-r--r-- | graphql/connections/connections.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/graphql/connections/connections.go b/graphql/connections/connections.go index 84dc3750..8b905fab 100644 --- a/graphql/connections/connections.go +++ b/graphql/connections/connections.go @@ -13,17 +13,18 @@ import ( const cursorPrefix = "cursor:" +// Edge define the contract for an edge in a relay connection type Edge interface { GetCursor() string } -// Creates the cursor string from an offset +// OffsetToCursor create the cursor string from an offset func OffsetToCursor(offset int) string { str := fmt.Sprintf("%v%v", cursorPrefix, offset) return base64.StdEncoding.EncodeToString([]byte(str)) } -// Re-derives the offset from the cursor string. +// CursorToOffset re-derives the offset from the cursor string. func CursorToOffset(cursor string) (int, error) { str := "" b, err := base64.StdEncoding.DecodeString(cursor) |