Skip to content

Commit eaa2be2

Browse files
tjgurwara99github-action
and
github-action
authored
feat: re-enable all linters (TheAlgorithms#541)
* 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>
1 parent 6a99cd7 commit eaa2be2

File tree

4 files changed

+17
-22
lines changed

4 files changed

+17
-22
lines changed

.golangci.yml

-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,2 @@
11
run:
22
go: 1.19
3-
linters:
4-
disable:
5-
- gosimple
6-
- staticcheck
7-
- structcheck
8-
- unused

README.md

+15-10
Original file line numberDiff line numberDiff line change
@@ -548,15 +548,20 @@ Read our [Contribution Guidelines](CONTRIBUTING.md) before you contribute.
548548
##### Functions:
549549

550550
1. [`Abs`](./math/abs.go#L11): Abs returns absolute value
551-
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)
552-
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.
553-
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.
554-
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.
555-
6. [`Mean`](./math/mean.go#L7): No description provided.
556-
7. [`Median`](./math/median.go#L12): No description provided.
557-
8. [`Mode`](./math/mode.go#L19): No description provided.
558-
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.
559-
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)
551+
2. [`Combinations`](./math/binomialcoefficient.go#L20): C is Binomial Coefficient function This function returns C(n, k) for given n and k
552+
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)
553+
4. [`DefaultPolynomial`](./math/pollard.go#L16): DefaultPolynomial is the commonly used polynomial g(x) = (x^2 + 1) mod n
554+
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.
555+
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.
556+
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.
557+
8. [`LiouvilleLambda`](./math/liouville.go#L24): Lambda is the liouville function This function returns λ(n) for given number
558+
9. [`Mean`](./math/mean.go#L7): No description provided.
559+
10. [`Median`](./math/median.go#L12): No description provided.
560+
11. [`Mode`](./math/mode.go#L19): No description provided.
561+
12. [`Mu`](./math/mobius.go#L21): Mu is the Mobius function This function returns μ(n) for given number
562+
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.
563+
14. [`PollardsRhoFactorization`](./math/pollard.go#L29): PollardsRhoFactorization is an implementation of Pollard's rho factorization algorithm using the default parameters x = y = 2
564+
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)
560565

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

872877
---
873878

874-
##### 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
879+
##### Package sort a package for demonstrating sorting algorithms in Go
875880

876881
---
877882
##### Functions:

math/mode.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ func Mode[T constraints.Number](numbers []T) (T, error) {
2727
}
2828

2929
for _, number := range numbers {
30-
if _, check := countMap[number]; check {
31-
countMap[number]++
32-
} else {
33-
countMap[number] = 1
34-
}
30+
countMap[number]++
3531
}
3632

3733
var mode T

sort/patiencesort.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
// Package sort
21
// Patience sorting is a sorting algorithm inspired by the card game patience.
32
//
43
// For more details check out those links below here:
54
// GeeksForGeeks article : https://www.geeksforgeeks.org/patience-sorting/
65
// Wikipedia article: https://en.wikipedia.org/wiki/Patience_sorting
76
// authors [guuzaa](https://github.com/guuzaa)
87
// see patiencesort.go
8+
99
package sort
1010

1111
import "github.com/TheAlgorithms/Go/constraints"

0 commit comments

Comments
 (0)