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" | |
"time" | |
) | |
func main() { | |
messageChannel := make(chan string) |
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" | |
"io" | |
"os" | |
) | |
func main() { | |
sourcePath := "source.txt" |
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" | |
"io" | |
"os" | |
) | |
func main() { | |
reader, writer := io.Pipe() |
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" | |
func main() { | |
var s []int | |
// len=0 cap=0 [] | |
s = append(s, 0) // append works on nil slices. | |
// len=1 cap=1 [0] |
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
src := []int{1, 2, 3, 4, 5} | |
dst := make([]int, 5) | |
// copy from slice to slice | |
copied := copy(dst, src) | |
// copied: 5 | |
// dst: [1 2 3 4 5] | |
// copy from string to slice | |
var b = make([]byte, 5) |
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
// Usage | |
let logger = Logger("YakuterPackage.ViewController") | |
logger.info("Result: %{public}@", result) | |
logger.error("This is an error log") | |
// Logger.swift file content |
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
// Method 1 | |
struct User { | |
} | |
enum SecurityError: Error { | |
case emptyEmail | |
case emptyPassword | |
} |
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
// Versiyon 2 | |
package main | |
import "fmt" | |
type Foo struct{} | |
func main() { | |
a := &Foo{} | |
b := &Foo{} |
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
// Versiyon 1 | |
package main | |
import "fmt" | |
type Foo struct{} | |
func main() { | |
a := &Foo{} | |
b := &Foo{} |
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
// This example shows how to send files via pipe using multipart package | |
package main | |
import ( | |
"errors" | |
"fmt" | |
"io" | |
"mime/multipart" | |
"os" |