From 4ec5712bd3c22639d8250a21acb2f73758123732 Mon Sep 17 00:00:00 2001 From: Konstantin8105 Date: Sat, 26 Nov 2022 20:47:04 +0300 Subject: [PATCH 1/4] golang: verification --- .github/workflows/build.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 250ab1a..d691ea9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,3 +21,27 @@ jobs: - name: Build run: go build ./... working-directory: raylib + - name: Verify dependencies + run: go mod verify + working-directory: raylib + - name: Build + run: go build -v ./... + working-directory: raylib + - name: Run go vet + run: go vet ./... + working-directory: raylib + - name: Install staticcheck + run: go install honnef.co/go/tools/cmd/staticcheck@latest + working-directory: raylib + - name: Run staticcheck + run: staticcheck ./... + working-directory: raylib + - name: Install golint + run: go install golang.org/x/lint/golint@latest + working-directory: raylib + - name: Run golint + run: golint ./... + working-directory: raylib + - name: Run tests + run: go test -race -vet=off ./... + working-directory: raylib From 5b3c524e0a0af126093ec63b5ae3e14dec707198 Mon Sep 17 00:00:00 2001 From: Konstantin8105 Date: Sat, 26 Nov 2022 20:54:05 +0300 Subject: [PATCH 2/4] staticcheck fix --- raylib/platform_desktop.go | 2 -- raylib/raymath.go | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/raylib/platform_desktop.go b/raylib/platform_desktop.go index 8b4e146..c01b84f 100644 --- a/raylib/platform_desktop.go +++ b/raylib/platform_desktop.go @@ -27,7 +27,6 @@ func InitWindow(width int32, height int32, title string) { // SetCallbackFunc - Sets callback function func SetCallbackFunc(func()) { - return } // ShowCursor - Shows cursor @@ -87,7 +86,6 @@ func LoadDroppedFiles() []string { // UnloadDroppedFiles - Unload dropped filepaths func UnloadDroppedFiles() { - return } // OpenAsset - Open asset diff --git a/raylib/raymath.go b/raylib/raymath.go index 0d4bbae..896f73c 100644 --- a/raylib/raymath.go +++ b/raylib/raymath.go @@ -174,8 +174,6 @@ func Vector3CrossProduct(v1, v2 Vector3) Vector3 { // Vector3Perpendicular - Calculate one vector perpendicular vector func Vector3Perpendicular(v Vector3) Vector3 { - result := Vector3{} - min := math.Abs(float64(v.X)) cardinalAxis := NewVector3(1.0, 0.0, 0.0) @@ -188,7 +186,7 @@ func Vector3Perpendicular(v Vector3) Vector3 { cardinalAxis = NewVector3(0.0, 0.0, 1.0) } - result = Vector3CrossProduct(v, cardinalAxis) + result := Vector3CrossProduct(v, cardinalAxis) return result } From 174a597b392572aa6fb16e7d5a9d548a65e2ad79 Mon Sep 17 00:00:00 2001 From: Konstantin8105 Date: Sat, 26 Nov 2022 21:02:24 +0300 Subject: [PATCH 3/4] fix by golint --- .github/workflows/build.yml | 6 ------ raylib/raylib.go | 5 +++-- raylib/raymath.go | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d691ea9..71c4e77 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,12 +36,6 @@ jobs: - name: Run staticcheck run: staticcheck ./... working-directory: raylib - - name: Install golint - run: go install golang.org/x/lint/golint@latest - working-directory: raylib - - name: Run golint - run: golint ./... - working-directory: raylib - name: Run tests run: go test -race -vet=off ./... working-directory: raylib diff --git a/raylib/raylib.go b/raylib/raylib.go index a87909e..7720762 100644 --- a/raylib/raylib.go +++ b/raylib/raylib.go @@ -1,5 +1,5 @@ /* -Package raylib - Go bindings for raylib, a simple and easy-to-use library to learn videogames programming. +Package rl - Go bindings for raylib, a simple and easy-to-use library to learn videogames programming. raylib is highly inspired by Borland BGI graphics lib and by XNA framework. @@ -848,7 +848,7 @@ type MaterialMap struct { Value float32 } -// Model, meshes, materials and animation data +// Model is struct of model, meshes, materials and animation data type Model struct { // Local transform matrix Transform Matrix @@ -1195,6 +1195,7 @@ func newRenderTexture2DFromPointer(ptr unsafe.Pointer) RenderTexture2D { return *(*RenderTexture2D)(ptr) } +// TraceLogLevel parameter of trace log message type TraceLogLevel int // Trace log level diff --git a/raylib/raymath.go b/raylib/raymath.go index 896f73c..c616d16 100644 --- a/raylib/raymath.go +++ b/raylib/raymath.go @@ -60,7 +60,7 @@ func Vector2Negate(v Vector2) Vector2 { return NewVector2(-v.X, -v.Y) } -// Vector2Divide - Divide vector by vector +// Vector2DivideV - Divide vector by vector func Vector2DivideV(v1, v2 Vector2) Vector2 { return NewVector2(v1.X/v2.X, v1.Y/v2.Y) } From 3a6db7b9f249ed592983cca1787140ac954eec14 Mon Sep 17 00:00:00 2001 From: Konstantin8105 Date: Sat, 26 Nov 2022 21:07:47 +0300 Subject: [PATCH 4/4] fix --- raylib/raylib.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/raylib/raylib.go b/raylib/raylib.go index 7720762..31e383f 100644 --- a/raylib/raylib.go +++ b/raylib/raylib.go @@ -1,5 +1,5 @@ /* -Package rl - Go bindings for raylib, a simple and easy-to-use library to learn videogames programming. +Package raylib - Go bindings for raylib, a simple and easy-to-use library to learn videogames programming. raylib is highly inspired by Borland BGI graphics lib and by XNA framework.