Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

signature_nogogit.go 774B

123456789101112131415161718192021222324252627282930
  1. // Copyright 2015 The Gogs Authors. All rights reserved.
  2. // Copyright 2019 The Gitea Authors. All rights reserved.
  3. // SPDX-License-Identifier: MIT
  4. //go:build !gogit
  5. package git
  6. import (
  7. "fmt"
  8. "time"
  9. "code.gitea.io/gitea/modules/util"
  10. )
  11. // Signature represents the Author, Committer or Tagger information.
  12. type Signature struct {
  13. Name string // the committer name, it can be anything
  14. Email string // the committer email, it can be anything
  15. When time.Time // the timestamp of the signature
  16. }
  17. func (s *Signature) String() string {
  18. return fmt.Sprintf("%s <%s>", s.Name, s.Email)
  19. }
  20. // Decode decodes a byte array representing a signature to signature
  21. func (s *Signature) Decode(b []byte) {
  22. *s = *parseSignatureFromCommitLine(util.UnsafeBytesToString(b))
  23. }