File: writeable.go

package info (click to toggle)
gh 2.46.0-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 15,548 kB
  • sloc: sh: 227; makefile: 117
file content (12 lines) | stat: -rw-r--r-- 278 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
package shared

import (
	"strings"

	"github.com/cli/cli/v2/internal/config"
)

func AuthTokenWriteable(authCfg *config.AuthConfig, hostname string) (string, bool) {
	token, src := authCfg.ActiveToken(hostname)
	return src, (token == "" || !strings.HasSuffix(src, "_TOKEN"))
}