@@ -54,23 +54,23 @@ func Err() *big.Int { return big.NewInt(0).Set(err) }
5454//
5555// If given bytes contains value that is greater than given precision it
5656// returns infinity or negative infinity value accordingly the bytes sign.
57- func FromBytes (bts []byte , precision , scale uint32 ) * big.Int {
57+ func FromBytes (bts []byte , precision , scale uint32 ) * big.Int { //nolint:ifshort
5858 v := big .NewInt (0 )
5959 if len (bts ) == 0 {
6060 return v
6161 }
6262
6363 v .SetBytes (bts )
64-
65- if neg := bts [ 0 ] & negMask != 0 ; neg {
64+ neg := bts [ 0 ] & negMask != 0
65+ if neg {
6666 // Given bytes contains negative value.
6767 // Interpret is as two's complement.
6868 not (v )
6969 v .Add (v , one )
7070 v .Neg (v )
7171 }
7272 if v .CmpAbs (pow (ten , precision )) >= 0 {
73- if neg := bts [ 0 ] & negMask != 0 ; neg {
73+ if neg {
7474 v .Set (neginf )
7575 } else {
7676 v .Set (inf )
@@ -88,9 +88,7 @@ func FromInt128(p [16]byte, precision, scale uint32) *big.Int {
8888
8989// Parse interprets a string s with the given precision and scale and returns
9090// the corresponding big integer.
91- //
92- //nolint:ifshort
93- func Parse (s string , precision , scale uint32 ) (* big.Int , error ) {
91+ func Parse (s string , precision , scale uint32 ) (* big.Int , error ) { //nolint:ifshort
9492 if scale > precision {
9593 return nil , precisionError (s , precision , scale )
9694 }
@@ -192,9 +190,7 @@ func Parse(s string, precision, scale uint32) (*big.Int, error) {
192190
193191// Format returns the string representation of x with the given precision and
194192// scale.
195- //
196- //nolint:ifshort //Can't place variable inside if scope because it's used below
197- func Format (x * big.Int , precision , scale uint32 ) string {
193+ func Format (x * big.Int , precision , scale uint32 ) string { //nolint:ifshort
198194 switch {
199195 case x .CmpAbs (inf ) == 0 :
200196 if x .Sign () < 0 {
@@ -290,8 +286,7 @@ func BigIntToByte(x *big.Int, precision, scale uint32) (p [16]byte) {
290286 return p
291287}
292288
293- //nolint:ifshort //Can't place variable inside if scope because it's used one more time below
294- func put (x * big.Int , p []byte ) {
289+ func put (x * big.Int , p []byte ) { //nolint:ifshort
295290 neg := x .Sign () < 0
296291 if neg {
297292 x = complement (x )
0 commit comments