add a copyright notice with original author

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2023-10-30 14:40:07 +01:00 committed by Nicolas De loof
parent b847c7f5a4
commit 0d905a896d
6 changed files with 25 additions and 1 deletions

View File

@ -21,6 +21,10 @@ import (
"path/filepath"
)
// Based on https://github.com/adrg/xdg
// Licensed under MIT License (MIT)
// Copyright (c) 2014 Adrian-George Bostan <adrg@epistack.com>
func osDependentRunDir() (string, error) {
home, err := os.UserHomeDir()
if err != nil {

View File

@ -24,10 +24,14 @@ import (
"strconv"
)
// Based on https://github.com/adrg/xdg
// Licensed under MIT License (MIT)
// Copyright (c) 2014 Adrian-George Bostan <adrg@epistack.com>
func osDependentRunDir() (string, error) {
run := filepath.Join("run", "user", strconv.Itoa(os.Getuid()))
if _, err := os.Stat(run); err == nil {
return run
return run, nil
}
// /run/user/$uid is set by pam_systemd, but might not be present, especially in containerized environments

View File

@ -23,6 +23,10 @@ import (
"golang.org/x/sys/windows"
)
// Based on https://github.com/adrg/xdg
// Licensed under MIT License (MIT)
// Copyright (c) 2014 Adrian-George Bostan <adrg@epistack.com>
func osDependentRunDir() (string, error) {
flags := []uint32{windows.KF_FLAG_DEFAULT, windows.KF_FLAG_DEFAULT_PATH}
for _, flag := range flags {

View File

@ -21,6 +21,10 @@ import (
"path/filepath"
)
// Based on https://github.com/adrg/xdg
// Licensed under MIT License (MIT)
// Copyright (c) 2014 Adrian-George Bostan <adrg@epistack.com>
func osDependentCacheDir() (string, error) {
home, err := os.UserHomeDir()
if err != nil {

View File

@ -23,6 +23,10 @@ import (
"path/filepath"
)
// Based on https://github.com/adrg/xdg
// Licensed under MIT License (MIT)
// Copyright (c) 2014 Adrian-George Bostan <adrg@epistack.com>
func osDependentCacheDir() (string, error) {
home, err := os.UserHomeDir()
if err != nil {

View File

@ -23,6 +23,10 @@ import (
"golang.org/x/sys/windows"
)
// Based on https://github.com/adrg/xdg
// Licensed under MIT License (MIT)
// Copyright (c) 2014 Adrian-George Bostan <adrg@epistack.com>
func osDependentCacheDir() (string, error) {
flags := []uint32{windows.KF_FLAG_DEFAULT, windows.KF_FLAG_DEFAULT_PATH}
for _, flag := range flags {