init
This commit is contained in:
commit
4e0ee26673
|
@ -0,0 +1,2 @@
|
|||
.idea/
|
||||
golang-intro
|
|
@ -0,0 +1,11 @@
|
|||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func FizzBuzz() {
|
||||
for i := 0; i < 20; i++ {
|
||||
var out string
|
||||
|
||||
fmt.Println(out)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func foo(bar string) string {
|
||||
return "fooo" + bar
|
||||
}
|
||||
|
||||
func main() {
|
||||
// fmt.Printf("Hello %s", foo("World"))
|
||||
FizzBuzz()
|
||||
}
|
||||
|
||||
func barcamp() {
|
||||
bar := &Barcamp{
|
||||
Title: "local-it Barcamp 2022",
|
||||
Foo: 42,
|
||||
}
|
||||
|
||||
bar.Title = "local-it Barcamp 2023"
|
||||
|
||||
bar.Code()
|
||||
|
||||
fmt.Println(bar)
|
||||
}
|
||||
|
||||
type Barcamp struct {
|
||||
Title string
|
||||
Foo int
|
||||
}
|
||||
|
||||
func (b *Barcamp) Code() {
|
||||
fmt.Println("Code")
|
||||
}
|
||||
|
||||
func (b *Barcamp) String() string {
|
||||
return b.Title
|
||||
}
|
Loading…
Reference in New Issue