More documentation fixes

This commit is contained in:
Daniel Huigens 2019-05-15 14:57:35 +02:00
parent 388fa872e7
commit 4ef882c564
8 changed files with 26 additions and 18 deletions

View file

@ -1,3 +1,4 @@
// Package internal contains internal methods and constants.
package internal
import (
@ -6,17 +7,18 @@ import (
"github.com/ProtonMail/gopenpgp/constants"
)
// TrimNewlines removes a whitespace in the end of string (don't stop on linebreak)
// TrimNewlines removes whitespace from the end of each line of the input
// string.
func TrimNewlines(input string) string {
var re = regexp.MustCompile(`(?m)[ \t]*$`)
return re.ReplaceAllString(input, "")
}
// CreationTimeOffset stores the amount of seconds that a signature may be
// created in the future, to compensate for clock skew
// created in the future, to compensate for clock skew.
const CreationTimeOffset = int64(60 * 60 * 24 * 2)
// ArmorHeaders from gopenpgp
// ArmorHeaders is a map of default armor headers.
var ArmorHeaders = map[string]string{
"Version": constants.ArmorHeaderVersion,
"Comment": constants.ArmorHeaderComment,