View transact.go
This file contains 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" | |
"database/sql" | |
_ "github.com/mattn/go-sqlite3" | |
"log" | |
) | |
func main() { |
View controller.go
This file contains 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 controllers | |
import ( | |
"Go-Tutorials/models" | |
"github.com/gin-gonic/gin" | |
"net/http" | |
) | |
type CreateBookInput struct { | |
Title string `json:"title" binding:"required"` |
View chrouter.go
This file contains 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 ( | |
"encoding/json" | |
"github.com/go-chi/chi" | |
"github.com/go-chi/chi/middleware" | |
"log" | |
"net/http" | |
) |
View suffering.go
This file contains 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" | |
"gorm.io/driver/postgres" | |
"gorm.io/gorm" | |
"log" | |
"os" | |
) |
View gin.go
This file contains 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 ( | |
"github.com/gin-gonic/gin" | |
"gorm.io/driver/sqlite" | |
"gorm.io/gorm" | |
"log" | |
"net/http" | |
) |
View jwt.go
This file contains 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 ( | |
"encoding/json" | |
"fmt" | |
"github.com/golang-jwt/jwt" | |
"log" | |
"net/http" | |
"time" | |
) |
View fltk.rs
This file contains 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
// [dependencies] | |
// fltk = { version = "^1.3", features = ["fltk-bundled"] } | |
use fltk::{app, prelude::*, window::Window}; | |
fn my_app() { | |
let app = app::App::default(); | |
let mut app_window = Window::new(100, 100, 400, 300, "Checking out the FLTK-rs Library"); | |
app_window.end(); |
View generator.go
This file contains 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
func generateCryptoRandom(chars string, length int32) string { | |
bytes := make([]byte, length) _, err := rand.Read(bytes) | |
if err != nil { | |
fmt.Println(err) | |
} |
View nethttp.go
This file contains 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 ( | |
"encoding/json" | |
"log" | |
"net/http" | |
) | |
type Person struct { | |
Name string `json:"name"` |
View linkedlist.go
This file contains 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" | |
type Node struct { | |
data any | |
next *Node | |
} | |
type LinkedList struct { |
NewerOlder