Skip to content

Commit

Permalink
feat: re-enable all linters (TheAlgorithms#541)
Browse files Browse the repository at this point in the history
* Updated Documentation in README.md

* fix: golangci-lint disabled linters and checks

* Updated Documentation in README.md

* fix: documentation comment issue

* Updated Documentation in README.md

Co-authored-by: github-action <${GITHUB_ACTOR}@users.noreply.github.com>
  • Loading branch information
tjgurwara99 and github-action authored Sep 23, 2022
1 parent 6a99cd7 commit eaa2be2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 22 deletions.
6 changes: 0 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
run:
go: 1.19
linters:
disable:
- gosimple
- staticcheck
- structcheck
- unused
25 changes: 15 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -548,15 +548,20 @@ Read our [Contribution Guidelines](CONTRIBUTING.md) before you contribute.
##### Functions:

1. [`Abs`](./math/abs.go#L11): Abs returns absolute value
2. [`Cos`](./math/cos.go#L10): Cos returns the cosine of the radian argument x. [See more](https://en.wikipedia.org/wiki/Sine_and_cosine) [Based on the idea of Bhaskara approximation of cos(x)](https://math.stackexchange.com/questions/3886552/bhaskara-approximation-of-cosx)
3. [`FindKthMax`](./math/kthnumber.go#L11): FindKthMax returns the kth large element given an integer slice with nil `error` if found and returns -1 with `error` `search.ErrNotFound` if not found. NOTE: The `nums` slice gets mutated in the process.
4. [`FindKthMin`](./math/kthnumber.go#L19): FindKthMin returns kth small element given an integer slice with nil `error` if found and returns -1 with `error` `search.ErrNotFound` if not found. NOTE: The `nums` slice gets mutated in the process.
5. [`IsPowOfTwoUseLog`](./math/checkisnumberpoweroftwo.go#L10): IsPowOfTwoUseLog This function checks if a number is a power of two using the logarithm. The limiting degree can be from 0 to 63. See alternatives in the binary package.
6. [`Mean`](./math/mean.go#L7): No description provided.
7. [`Median`](./math/median.go#L12): No description provided.
8. [`Mode`](./math/mode.go#L19): No description provided.
9. [`Phi`](./math/eulertotient.go#L5): Phi is the Euler totient function. This function computes the number of numbers less then n that are coprime with n.
10. [`Sin`](./math/sin.go#L9): Sin returns the sine of the radian argument x. [See more](https://en.wikipedia.org/wiki/Sine_and_cosine)
2. [`Combinations`](./math/binomialcoefficient.go#L20): C is Binomial Coefficient function This function returns C(n, k) for given n and k
3. [`Cos`](./math/cos.go#L10): Cos returns the cosine of the radian argument x. [See more](https://en.wikipedia.org/wiki/Sine_and_cosine) [Based on the idea of Bhaskara approximation of cos(x)](https://math.stackexchange.com/questions/3886552/bhaskara-approximation-of-cosx)
4. [`DefaultPolynomial`](./math/pollard.go#L16): DefaultPolynomial is the commonly used polynomial g(x) = (x^2 + 1) mod n
5. [`FindKthMax`](./math/kthnumber.go#L11): FindKthMax returns the kth large element given an integer slice with nil `error` if found and returns -1 with `error` `search.ErrNotFound` if not found. NOTE: The `nums` slice gets mutated in the process.
6. [`FindKthMin`](./math/kthnumber.go#L19): FindKthMin returns kth small element given an integer slice with nil `error` if found and returns -1 with `error` `search.ErrNotFound` if not found. NOTE: The `nums` slice gets mutated in the process.
7. [`IsPowOfTwoUseLog`](./math/checkisnumberpoweroftwo.go#L10): IsPowOfTwoUseLog This function checks if a number is a power of two using the logarithm. The limiting degree can be from 0 to 63. See alternatives in the binary package.
8. [`LiouvilleLambda`](./math/liouville.go#L24): Lambda is the liouville function This function returns λ(n) for given number
9. [`Mean`](./math/mean.go#L7): No description provided.
10. [`Median`](./math/median.go#L12): No description provided.
11. [`Mode`](./math/mode.go#L19): No description provided.
12. [`Mu`](./math/mobius.go#L21): Mu is the Mobius function This function returns μ(n) for given number
13. [`Phi`](./math/eulertotient.go#L5): Phi is the Euler totient function. This function computes the number of numbers less then n that are coprime with n.
14. [`PollardsRhoFactorization`](./math/pollard.go#L29): PollardsRhoFactorization is an implementation of Pollard's rho factorization algorithm using the default parameters x = y = 2
15. [`Sin`](./math/sin.go#L9): Sin returns the sine of the radian argument x. [See more](https://en.wikipedia.org/wiki/Sine_and_cosine)

---
</details><details>
Expand Down Expand Up @@ -871,7 +876,7 @@ Read our [Contribution Guidelines](CONTRIBUTING.md) before you contribute.

---

##### Package sort a package for demonstrating sorting algorithms in Go Package sort Patience sorting is a sorting algorithm inspired by the card game patience. For more details check out those links below here: GeeksForGeeks article : https://www.geeksforgeeks.org/patience-sorting/ Wikipedia article: https://en.wikipedia.org/wiki/Patience_sorting authors [guuzaa](https://github.com/guuzaa) see patiencesort.go
##### Package sort a package for demonstrating sorting algorithms in Go

---
##### Functions:
Expand Down
6 changes: 1 addition & 5 deletions math/mode.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ func Mode[T constraints.Number](numbers []T) (T, error) {
}

for _, number := range numbers {
if _, check := countMap[number]; check {
countMap[number]++
} else {
countMap[number] = 1
}
countMap[number]++
}

var mode T
Expand Down
2 changes: 1 addition & 1 deletion sort/patiencesort.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Package sort
// Patience sorting is a sorting algorithm inspired by the card game patience.
//
// For more details check out those links below here:
// GeeksForGeeks article : https://www.geeksforgeeks.org/patience-sorting/
// Wikipedia article: https://en.wikipedia.org/wiki/Patience_sorting
// authors [guuzaa](https://github.com/guuzaa)
// see patiencesort.go

package sort

import "github.com/TheAlgorithms/Go/constraints"
Expand Down

0 comments on commit eaa2be2

Please sign in to comment.