ghtoken

package
v0.109.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: BSD-3-Clause Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ghtoken reads the GitHub token every write command here uses, from a file and nowhere else: never a flag value, the environment or a URL.

It was six copies of one function (ghissue, ghpr, ghrel, ghrepo, ghrun, pullresidue), and five of them read the whole file before comparing its size with the bound. This one asks the file's size first, so a large file named by mistake is refused without being read.

Index

Constants

View Source
const MaxBytes = 4 << 10

MaxBytes bounds the token file: a token is tens of bytes.

Variables

This section is empty.

Functions

func Read

func Read(path string) (string, error)

Read returns the token in path (default ~/.github-token). The file must be a regular file that only its owner may read: the mode check is the point, a token in a world-readable file is already spent.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL