More documentation fixes
This commit is contained in:
parent
388fa872e7
commit
4ef882c564
8 changed files with 26 additions and 18 deletions
|
|
@ -5,7 +5,7 @@ import (
|
|||
"strings"
|
||||
)
|
||||
|
||||
// Unarmor from string
|
||||
// Unarmor unarmors an armored string.
|
||||
func Unarmor(input string) (*armor.Block, error) {
|
||||
io := strings.NewReader(input)
|
||||
b, err := armor.Decode(io)
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue