Add path to cookies. Fix #1580

This commit is contained in:
Deluan
2023-02-15 20:18:53 -05:00
parent 0ffdb2eee0
commit aac6e2cb07
4 changed files with 63 additions and 2 deletions
+14
View File
@@ -0,0 +1,14 @@
// Package gg implements simple "extensions" to Go language. Based on https://github.com/icza/gog
package gg
// IfZero returns v if it is a non-zero value, orElse otherwise.
//
// This is similar to elvis operator (?:) in Groovy and other languages.
// Note: Different from the real elvis operator, the orElse expression will always get evaluated.
func IfZero[T comparable](v T, orElse T) T {
var zero T
if v != zero {
return v
}
return orElse
}