Skip to content

Instantly share code, notes, and snippets.

package main
type Car struct {
ID string `json:"id"`
Title string `json:"title"`
Color string `json:"color"`
}
var Cars []Car
@disegmvm
disegmvm / main.go
Created January 20, 2023 20:06
Declaring slice of car structs you’ll use to start.
package main
type Car struct {
ID string `json:"id"`
Title string `json:"title"`
Color string `json:"color"`
}
var Cars []Car
@disegmvm
disegmvm / main.go
Created January 20, 2023 20:09
Declaring slice of car structs you’ll use to start.
package main
type Car struct {
ID string `json:"id"`
Title string `json:"title"`
Color string `json:"color"`
}
var Cars []Car
@disegmvm
disegmvm / main.go
Created January 20, 2023 20:11
Declaring slice of car structs you’ll use to start.
package main
import (
"github.com/gin-gonic/gin"
"net/http"
)
type Car struct {
ID string `json:"id"`
Title string `json:"title"`
package main
import (
"github.com/gin-gonic/gin" // Import the packages
"net/http" // needed for your code.
)
type Car struct { // Declaring Car struct.
ID string `json:"id"` // "json" tag specifies what a field’s
Title string `json:"title"` // name should be when the struct’s
package main
import (
"github.com/gin-gonic/gin" // Import the packages
"net/http" // needed for your code.
)
type Car struct { // Declaring Car struct.
ID string `json:"id"` // "json" tag specifies what a field’s
Title string `json:"title"` // name should be when the struct’s
package main
import (
"github.com/gin-gonic/gin" // Import the packages
"net/http" // needed for your code.
)
type Car struct { // Declaring Car struct.
ID string `json:"id"` // "json" tag specifies what a field’s
Title string `json:"title"` // name should be when the struct’s
package main
import (
"github.com/gin-gonic/gin" // Import the packages
"net/http" // needed for your code.
)
type Car struct { // Declaring Car struct.
ID string `json:"id"` // "json" tag specifies what a field’s
Title string `json:"title"` // name should be when the struct’s
package main
import (
"github.com/gin-gonic/gin" // Import the packages
"net/http" // needed for your code.
)
type Car struct { // Declaring Car struct.
ID string `json:"id"` // "json" tag specifies what a field’s
Title string `json:"title"` // name should be when the struct’s
package main
import (
"github.com/gin-gonic/gin" // Import the packages
"net/http" // needed for your code.
)
type Car struct { // Declaring Car struct.
ID string `json:"id"` // "json" tag specifies what a field’s
Title string `json:"title"` // name should be when the struct’s