Skip to content

Commit

Permalink
fix: typos in comments (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear committed May 9, 2023
1 parent ec659b5 commit d243db3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions cmd/internal/generate-tests/support.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ type TestCase struct {
Want string
}

// variate will create a set of variables to use within test fucntion
// variate will create a set of variables to use within test function
// if its a string function/method
// -> correct: all strins expected
// -> correct: all strings expected
//
// -> incorrect -> bytes ex
func variate(variance string, oneIsString bool) []string {
Expand All @@ -31,7 +31,7 @@ func variate(variance string, oneIsString bool) []string {
for i := 0; i < len(variance); i++ {
var input string

// if out argument is in string we gona take argument that is
// if out argument is in string we gonna take argument that is
if oneIsString {
input = `"foobar"`
} else {
Expand Down Expand Up @@ -95,7 +95,7 @@ func GenReturnelements(n int) string {
return string(ret)
}

// possible varialtions for arguments
// possible variations for arguments
func PossibleVariations(n int) []string {
if n <= 1 {
return []string{"1", "0"}
Expand Down
2 changes: 1 addition & 1 deletion internal/checker/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (c *Checker) Check(e *ast.CallExpr) *Violation {
//

if !ok {
return nil // can't be mached, so can't be checked.
return nil // can't be matched, so can't be checked.
}

// does call expression violates diagnostic rule for package function?
Expand Down
6 changes: 3 additions & 3 deletions internal/checker/violation.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ import (
"golang.org/x/tools/go/analysis"
)

// Type of violation: can be methodor function
// Type of violation: can be method or function
type ViolationType int

const (
Function ViolationType = iota + 1
Method
)

// Violation describs what message we going to give to a particular code violation
// Violation describes what message we going to give to a particular code violation
type Violation struct {
Type ViolationType // What type is violation? Method or Function?
Message string // Message on violation detection
Args []int // Indexes of the arguments needs to be checked

StringTargeted bool // String is expected? []byte otherwise.
Alternative Alternative // Alternative methods/functions to use.
Generate *Generate // Rules for genetation of tests.
Generate *Generate // Rules for generation of tests.
}

type Alternative struct {
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `mirror` [![Code Coverage](https://coveralls.io/repos/github/butuzov/mirror/badge.svg?branch=main)](https://coveralls.io/github/butuzov/mirror?branch=main) [![build status](https://github.com/butuzov/mirror/actions/workflows/main.yaml/badge.svg?branch=main)]()

`mirror` suggests use of alternative functions/methods in order to gain performance boosts by avoiding unnecessary `[]byte/string` convertion calls. See [MIRROR_FUNCS.md](MIRROR_FUNCS.md) list of mirror functions you can use in go's stdlib.
`mirror` suggests use of alternative functions/methods in order to gain performance boosts by avoiding unnecessary `[]byte/string` conversion calls. See [MIRROR_FUNCS.md](MIRROR_FUNCS.md) list of mirror functions you can use in go's stdlib.

## 🇺🇦 PLEASE HELP ME 🇺🇦
Fundrise for scout drone **DJI Matrice 30T** for my squad (Ukrainian Forces). See more details at [butuzov/README.md](https://github.com/butuzov/butuzov/)
Expand Down

0 comments on commit d243db3

Please sign in to comment.