This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyright (c) 2026 thorsphere. | |
| // All Rights Reserved. Use is governed with GNU Affero General Public License v3.0 | |
| // that can be found in the LICENSE file. | |
| package tsecon | |
| // Import standard library packages and third-party packages for database/sql, time, and custom error handling and file I/O utilities. | |
| import ( | |
| "context" | |
| "database/sql" // database/sql for interacting with the SQLite database | |
| "time" // time for handling event timestamps |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Safe_var.go provides thread-safe variables of any type. The value of the variable is retrieved by Get. | |
| // The value of the variable is set with Set. | |
| // | |
| // Version v1.0 | |
| // Date 13 Aug 2023 | |
| // | |
| // Copyright (c) 2023 thorstenrie. | |
| // All Rights Reserved. Use is governed with GNU Affero General Public License v3.0 | |
| // that can be found in the LICENSE file. | |
| package main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "time" | |
| ) | |
| // A key for context.WithValue should be of its own type and should not be a built-in type like string | |
| // to avoid collisions between packages using contexts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "sync" | |
| ) | |
| type Fetcher interface { | |
| Fetch(url string) (body string, urls[]string, err error) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "golang.org/x/tour/pic" | |
| "image" | |
| "image/color" | |
| ) | |
| type Image struct{ | |
| w, h int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "math" | |
| ) | |
| // Constants | |
| const i_max int = 100 | |
| const v_test float64 = 123.987 |