Ajout d'un mutex pour pouvoir mettre à jour via une goroutine la liste des messages

This commit is contained in:
Laurent Ulrich
2025-08-08 10:59:51 +02:00
parent 614a6059f5
commit 9f88d84513
5 changed files with 42 additions and 31 deletions

20
blog.go
View File

@@ -1,18 +1,24 @@
package main
import "html/template"
import (
"html/template"
"sync"
)
type Post struct {
Id string
Title string
Author string
Date string
HTML template.HTML
Text string
BlogTitle string
Lang string
Id string
Title string
Author string
Date string
HTML template.HTML
Text string
}
type Blog struct {
Title string
Lang string
Posts []Post
mutex sync.Mutex
}