[Go] basics and web

This commit is contained in:
2026-03-02 01:47:42 +01:00
parent c88211d161
commit d83f0833ec
11 changed files with 320 additions and 0 deletions

62
slides/go/main.go Normal file
View File

@@ -0,0 +1,62 @@
package main
import (
"net/http"
)
type Point struct {
x int
y int
}
type Boja int
const (
plava = iota //asc
zuta
crvena
)
const (
plava = iota << 1
zuta // 010
crvena // 100
)
type Vektor2d struct {
x int
y int
}
type Vektor3d struct {
x ,y, z int
}
type(p Point) D
type Vektor interface {
Duzina() float32
}
func main() {
p:= Vektor2d[
x:1,
y:1
]
fmt.Println(p.)
// web server
http.HandleFunc("/", a )
http.ListenAndServe(":8080", nil)
}
func a(w http.ResponseWriter, r *http.Request){
w.Write([]byte("Hello Web"))
}