chore: initialize containerized Go learning workbook (2026 DevOps/SRE)
This commit is contained in:
commit
84be3e5d77
64 files changed
+1382
No files matched your search
@@ -0,0 +1,22 @@
|
||||
package audit
|
||||
|
||||
import "strings"
|
||||
|
||||
// BUG: brak synchronizacji (sync.Mutex lub atomic.Int64) -> data race pod `go test -race`!
|
||||
type Counter struct {
|
||||
value int64
|
||||
}
|
||||
|
||||
func (c *Counter) Inc() {
|
||||
c.value++
|
||||
}
|
||||
|
||||
func (c *Counter) Value() int64 {
|
||||
return c.value
|
||||
}
|
||||
|
||||
// BUG: panikuje gdy brak spacji, nie sprawdza prefiksu "Bearer ", przepuszcza pusty token!
|
||||
func ExtractBearerToken(header string) (string, bool) {
|
||||
parts := strings.Split(header, " ")
|
||||
return parts[1], true
|
||||
}
|
||||
Reference in new issue
Block a user