From 7e1cf349aacfec265ad8ed6557a8a251fef55e82 Mon Sep 17 00:00:00 2001 From: Milan Nikolic Date: Tue, 21 Feb 2017 15:19:22 +0100 Subject: [PATCH] Golint --- easings/easings.go | 56 +++++++++++++++++++++++----------------------- raygui/raygui.go | 4 ++-- raylib/audio.go | 6 ++--- raylib/camera.go | 2 +- raylib/core.go | 2 +- raylib/doc.go | 2 +- raylib/gestures.go | 4 ++-- raylib/models.go | 2 +- raylib/rres.go | 4 ++-- raylib/shaders.go | 4 ++-- raylib/text.go | 2 +- raylib/textures.go | 6 ++--- raymath/raymath.go | 2 +- 13 files changed, 48 insertions(+), 48 deletions(-) diff --git a/easings/easings.go b/easings/easings.go index 3545cde..7e79e2a 100644 --- a/easings/easings.go +++ b/easings/easings.go @@ -9,57 +9,57 @@ import ( // Linear Easing functions -// LinearNone +// LinearNone easing func LinearNone(t, b, c, d float32) float32 { return c*t/d + b } -// LinearIn +// LinearIn easing func LinearIn(t, b, c, d float32) float32 { return c*t/d + b } -// LinearOut +// LinearOut easing func LinearOut(t, b, c, d float32) float32 { return c*t/d + b } -// LinearInOut +// LinearInOut easing func LinearInOut(t, b, c, d float32) float32 { return c*t/d + b } // Sine Easing functions -// SineIn +// SineIn easing func SineIn(t, b, c, d float32) float32 { return -c*float32(math.Cos(float64(t/d)*(math.Pi/2))) + c + b } -// SineOut +// SineOut easing func SineOut(t, b, c, d float32) float32 { return c*float32(math.Sin(float64(t/d)*(math.Pi/2))) + b } -// SineInOut +// SineInOut easing func SineInOut(t, b, c, d float32) float32 { return -c/2*(float32(math.Cos(math.Pi*float64(t/d)))-1) + b } // Circular Easing functions -// CircIn +// CircIn easing func CircIn(t, b, c, d float32) float32 { t = t / d return -c*(float32(math.Sqrt(float64(1-t*t)))-1) + b } -// CircOut +// CircOut easing func CircOut(t, b, c, d float32) float32 { return c*float32(math.Sqrt(1-float64((t/d-1)*t))) + b } -// CircInOut +// CircInOut easing func CircInOut(t, b, c, d float32) float32 { t = t / d * 2 @@ -73,19 +73,19 @@ func CircInOut(t, b, c, d float32) float32 { // Cubic Easing functions -// CubicIn +// CubicIn easing func CubicIn(t, b, c, d float32) float32 { t = t / d return c*t*t*t + b } -// CubicOut +// CubicOut easing func CubicOut(t, b, c, d float32) float32 { t = t/d - 1 return c*(t*t*t+1) + b } -// CubicInOut +// CubicInOut easing func CubicInOut(t, b, c, d float32) float32 { t = t / d * 2 if t < 1 { @@ -98,19 +98,19 @@ func CubicInOut(t, b, c, d float32) float32 { // Quadratic Easing functions -// QuadIn +// QuadIn easing func QuadIn(t, b, c, d float32) float32 { t = t / d return c*t*t + b } -// QuadOut +// QuadOut easing func QuadOut(t, b, c, d float32) float32 { t = t / d return (-c*t*(t-2) + b) } -// QuadInOut +// QuadInOut easing func QuadInOut(t, b, c, d float32) float32 { t = t / d * 2 if t < 1 { @@ -122,7 +122,7 @@ func QuadInOut(t, b, c, d float32) float32 { // Exponential Easing functions -// ExpoIn +// ExpoIn easing func ExpoIn(t, b, c, d float32) float32 { if t == 0 { return b @@ -131,7 +131,7 @@ func ExpoIn(t, b, c, d float32) float32 { return (c*float32(math.Pow(2, 10*float64(t/d-1))) + b) } -// ExpoOut +// ExpoOut easing func ExpoOut(t, b, c, d float32) float32 { if t == d { return (b + c) @@ -140,7 +140,7 @@ func ExpoOut(t, b, c, d float32) float32 { return c*(-float32(math.Pow(2, -10*float64(t/d)))+1) + b } -// ExpoInOut +// ExpoInOut easing func ExpoInOut(t, b, c, d float32) float32 { if t == 0 { return b @@ -161,21 +161,21 @@ func ExpoInOut(t, b, c, d float32) float32 { // Back Easing functions -// BackIn +// BackIn easing func BackIn(t, b, c, d float32) float32 { s := float32(1.70158) t = t / d return c*t*t*((s+1)*t-s) + b } -// BackOut +// BackOut easing func BackOut(t, b, c, d float32) float32 { s := float32(1.70158) t = t/d - 1 return c*(t*t*((s+1)*t+s)+1) + b } -// BackInOut +// BackInOut easing func BackInOut(t, b, c, d float32) float32 { s := float32(1.70158) s = s * 1.525 @@ -191,12 +191,12 @@ func BackInOut(t, b, c, d float32) float32 { // Bounce Easing functions -// BounceIn +// BounceIn easing func BounceIn(t, b, c, d float32) float32 { return (c - BounceOut(d-t, 0, c, d) + b) } -// BounceOut +// BounceOut easing func BounceOut(t, b, c, d float32) float32 { t = t / d if t < (1 / 2.75) { @@ -213,7 +213,7 @@ func BounceOut(t, b, c, d float32) float32 { return c*(7.5625*t*t+0.984375) + b } -// BounceInOut +// BounceInOut easing func BounceInOut(t, b, c, d float32) float32 { if t < d/2 { return BounceIn(t*2, 0, c, d)*0.5 + b @@ -224,7 +224,7 @@ func BounceInOut(t, b, c, d float32) float32 { // Elastic Easing functions -// ElasticIn +// ElasticIn easing func ElasticIn(t, b, c, d float32) float32 { if t == 0 { return b @@ -244,7 +244,7 @@ func ElasticIn(t, b, c, d float32) float32 { return -(postFix * float32(math.Sin(float64(t*d-s)*(2*math.Pi)/float64(p)))) + b } -// ElasticOut +// ElasticOut easing func ElasticOut(t, b, c, d float32) float32 { if t == 0 { return b @@ -263,7 +263,7 @@ func ElasticOut(t, b, c, d float32) float32 { return a*float32(math.Pow(2, -10*float64(t)))*float32(math.Sin(float64(t*d-s)*(2*math.Pi)/float64(p))) + c + b } -// ElasticInOut +// ElasticInOut easing func ElasticInOut(t, b, c, d float32) float32 { if t == 0 { return b diff --git a/raygui/raygui.go b/raygui/raygui.go index 5d80b60..8af0605 100644 --- a/raygui/raygui.go +++ b/raygui/raygui.go @@ -1,4 +1,4 @@ -// raygui is simple and easy-to-use IMGUI (immediate mode GUI API) library. +// Package raygui - Simple and easy-to-use IMGUI (immediate mode GUI API) library package raygui import ( @@ -11,7 +11,7 @@ import ( "github.com/gen2brain/raylib-go/raylib" ) -// GUI property +// Property - GUI property type Property int32 // GUI properties enumeration diff --git a/raylib/audio.go b/raylib/audio.go index 34de2d1..c54325e 100644 --- a/raylib/audio.go +++ b/raylib/audio.go @@ -64,7 +64,7 @@ func NewSoundFromPointer(ptr unsafe.Pointer) Sound { // NOTE: Anything longer than ~10 seconds should be streamed type Music C.Music -// Audio stream type +// AudioStream type // NOTE: Useful to create custom audio streams not bound to a specific file type AudioStream struct { // Frequency (samples per second) @@ -327,8 +327,8 @@ func SetMusicPitch(music Music, pitch float32) { C.SetMusicPitch(cmusic, cpitch) } -// Set music loop count (loop repeats) -// SetMusicLoopCount - NOTE: If set to -1, means infinite loop +// SetMusicLoopCount - Set music loop count (loop repeats) +// NOTE: If set to -1, means infinite loop func SetMusicLoopCount(music Music, count float32) { cmusic := *(*C.Music)(unsafe.Pointer(&music)) ccount := (C.float)(count) diff --git a/raylib/camera.go b/raylib/camera.go index 4144d3a..8e38a26 100644 --- a/raylib/camera.go +++ b/raylib/camera.go @@ -60,7 +60,7 @@ func NewCamera2DFromPointer(ptr unsafe.Pointer) Camera2D { return *(*Camera2D)(ptr) } -// Camera mode +// CameraMode type type CameraMode int32 // Camera system modes diff --git a/raylib/core.go b/raylib/core.go index c464802..bb86c45 100644 --- a/raylib/core.go +++ b/raylib/core.go @@ -349,7 +349,7 @@ func NewRectangleFromPointer(ptr unsafe.Pointer) Rectangle { return *(*Rectangle)(ptr) } -// Bounding box +// BoundingBox type type BoundingBox struct { // Minimum vertex box-corner Min Vector3 diff --git a/raylib/doc.go b/raylib/doc.go index 3382e65..a18994a 100644 --- a/raylib/doc.go +++ b/raylib/doc.go @@ -1,2 +1,2 @@ -// 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 package raylib diff --git a/raylib/gestures.go b/raylib/gestures.go index 1e16da7..74bece1 100644 --- a/raylib/gestures.go +++ b/raylib/gestures.go @@ -6,10 +6,10 @@ package raylib import "C" import "unsafe" -// Gestures +// Gestures type type Gestures int32 -// Gestures type +// Gestures types // NOTE: It could be used as flags to enable only some gestures const ( GestureNone Gestures = C.GESTURE_NONE diff --git a/raylib/models.go b/raylib/models.go index f0fae46..67c2575 100644 --- a/raylib/models.go +++ b/raylib/models.go @@ -8,7 +8,7 @@ import "C" import "unsafe" import "reflect" -// Vertex data definning a mesh +// Mesh - Vertex data definning a mesh type Mesh struct { // Number of vertices stored in arrays VertexCount int32 diff --git a/raylib/rres.go b/raylib/rres.go index e1f1e79..39a182b 100644 --- a/raylib/rres.go +++ b/raylib/rres.go @@ -9,7 +9,7 @@ import ( "unsafe" ) -// rRES file header (8 byte) +// RRESFileHeader - rRES file header (8 byte) type RRESFileHeader struct { // File identifier: rRES (4 byte) ID [4]int8 @@ -19,7 +19,7 @@ type RRESFileHeader struct { Count uint16 } -// rRES info header, every resource includes this header (16 byte + 16 byte) +// RRESInfoHeader - rRES info header, every resource includes this header (16 byte + 16 byte) type RRESInfoHeader struct { // Resource unique identifier (4 byte) ID uint32 diff --git a/raylib/shaders.go b/raylib/shaders.go index d1df5e4..c4928e0 100644 --- a/raylib/shaders.go +++ b/raylib/shaders.go @@ -8,7 +8,7 @@ import "C" import "unsafe" import "reflect" -// Vr device +// VrDevice type type VrDevice int32 // Head Mounted Display devices @@ -24,7 +24,7 @@ const ( HmdFoveVr VrDevice = C.HMD_FOVE_VR ) -// Blend mode +// BlendMode type type BlendMode int32 // Color blending modes (pre-defined) diff --git a/raylib/text.go b/raylib/text.go index 3085426..a001097 100644 --- a/raylib/text.go +++ b/raylib/text.go @@ -7,7 +7,7 @@ package raylib import "C" import "unsafe" -// SpriteFont character info +// CharInfo - SpriteFont character info type CharInfo struct { // Character value (Unicode) Value int32 diff --git a/raylib/textures.go b/raylib/textures.go index 9653476..85abb51 100644 --- a/raylib/textures.go +++ b/raylib/textures.go @@ -7,7 +7,7 @@ package raylib import "C" import "unsafe" -// Texture format +// TextureFormat - Texture format type TextureFormat int32 // Texture formats @@ -51,7 +51,7 @@ const ( CompressedAstc8x8Rgba TextureFormat = C.COMPRESSED_ASTC_8x8_RGBA ) -// Texture filter mode +// TextureFilterMode - Texture filter mode type TextureFilterMode int32 // Texture parameters: filter mode @@ -72,7 +72,7 @@ const ( FilterAnisotropic16x TextureFilterMode = C.FILTER_ANISOTROPIC_16X ) -// Texture wrap mode +// TextureWrapMode - Texture wrap mode type TextureWrapMode int32 // Texture parameters: wrap mode diff --git a/raymath/raymath.go b/raymath/raymath.go index 53e2cfa..5cc5ce4 100644 --- a/raymath/raymath.go +++ b/raymath/raymath.go @@ -1,4 +1,4 @@ -// Some useful functions to work with Vector3, Matrix and Quaternions +// Package raymath - Some useful functions to work with Vector3, Matrix and Quaternions package raymath import (