Исходники и презентации

This commit is contained in:
2025-05-23 07:26:39 +03:00
parent aa948179d5
commit 02d8430a3a
514 changed files with 13773 additions and 0 deletions

View File

@ -0,0 +1,29 @@
package main
import (
"errors"
"fmt"
"io"
)
type Error string
func (e Error) Error() string {
return string(e)
}
const ErrEOF = Error("EOF")
func main() {
var err error = ErrEOF
err = io.EOF
_ = err
// ErrEOF = Error("new error") -> coplilation error
anotherErrEOF1 := Error("EOF")
fmt.Println(`anotherErrEOF1 = Error("EOF"):`, anotherErrEOF1 == ErrEOF)
anotherErrEOF2 := errors.New("EOF")
fmt.Println("anotherErrEOF2 = io.EOF:", anotherErrEOF2 == io.EOF)
}