minor formatting

This commit is contained in:
2024-12-28 01:40:30 +01:00
parent 293384862c
commit db702a0bb2
2 changed files with 6 additions and 7 deletions

View File

@@ -6,6 +6,7 @@ import (
"encoding/hex"
)
// TODO docstring
type Article struct {
Identifier uint
SourceUrl string
@@ -16,17 +17,18 @@ type Article struct {
}
// Generates a hash based on the source url of the article. Can be used to
// identify the article.
func (article *Article) Hash() string {
/* Generates a hash based on the source url of the article. Can be used to
* identify the article. */
hash := sha256.Sum256([]byte(article.SourceUrl))
return hex.EncodeToString(hash[:])
}
// --- implementation of the IIdentifiable interface ---
// --- implement IIdentifiable interface ---
// Using the Identifier attribute as the Id.
func (article *Article) Id() uint {
return article.Identifier
}