You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
golint flags quite a lot of issues, so I thought I'd summarize them here. Note golint checks for the recommendations in the CodeReviewComments wiki page, which have become pretty standard in Go projects. I personally think these are worth fixing, but I wanted to put it up for discussion.
don't use underscores in Go names: There are lots of examples of this.
comment on exported function NewSike503 should be of the form "NewSike503 ...": Go comment style recommends that comments for methods/functions/types are full sentences starting with the name of the thing being documented. Again there are quite a lot of examples of this.
All golint issues
dh/curve4Q/curve4Q.go:3:1: don't use MixedCaps in package name; curve4Q should be curve4q
dh/curve4Q/curve4Q_test.go:3:1: don't use MixedCaps in package name; curve4Q should be curve4q
dh/curve4Q/doc.go:8:1: don't use MixedCaps in package name; curve4Q should be curve4q
dh/sidh/sidh.go:12:1: comment on exported type KeyVariant should be of the form "KeyVariant ..." (with optional leading article)
dh/sidh/sidh.go:24:1: comment on exported type PublicKey should be of the form "PublicKey ..." (with optional leading article)
dh/sidh/sidh.go:31:1: comment on exported type PrivateKey should be of the form "PrivateKey ..." (with optional leading article)
dh/sidh/sidh.go:43:2: don't use ALL_CAPS in Go names; use CamelCase
dh/sidh/sidh.go:44:2: don't use ALL_CAPS in Go names; use CamelCase
dh/sidh/sidh.go:51:2: comment on exported const KeyVariant_SIDH_A should be of the form "KeyVariant_SIDH_A ..."
dh/sidh/sidh.go:52:2: don't use underscores in Go names; const KeyVariant_SIDH_A should be KeyVariantSIDHA
dh/sidh/sidh.go:53:2: comment on exported const KeyVariant_SIDH_B should be of the form "KeyVariant_SIDH_B ..."
dh/sidh/sidh.go:54:2: don't use underscores in Go names; const KeyVariant_SIDH_B should be KeyVariantSIDHB
dh/sidh/sidh.go:55:2: comment on exported const KeyVariant_SIKE should be of the form "KeyVariant_SIKE ..."
dh/sidh/sidh.go:56:2: don't use underscores in Go names; const KeyVariant_SIKE should be KeyVariantSIKE
dh/sidh/sidh.go:96:1: comment on exported method PublicKey.Export should be of the form "Export ..."
dh/sidh/sidh.go:138:1: comment on exported method PrivateKey.Export should be of the form "Export ..."
dh/sidh/sidh.go:154:1: comment on exported method PrivateKey.SharedSecretSize should be of the form "SharedSecretSize ..."
dh/sidh/sidh.go:172:1: comment on exported method PrivateKey.Generate should be of the form "Generate ..."
dh/sidh/sidh.go:213:1: comment on exported method PrivateKey.GeneratePublicKey should be of the form "GeneratePublicKey ..."
dh/sidh/sidh.go:239:1: comment on exported method PrivateKey.DeriveSecret should be of the form "DeriveSecret ..."
dh/sidh/sidh_test.go:229:2: don't use underscores in Go names; var a_hex should be aHex
dh/sidh/sidh_test.go:235:2: don't use underscores in Go names; var b_hex should be bHex
dh/sidh/sike.go:1:1: package comment should be of the form "Package sidh ..."
dh/sidh/sike.go:14:1: comment on exported type KEM should be of the form "KEM ..." (with optional leading article)
dh/sidh/sike.go:24:1: comment on exported function NewSike503 should be of the form "NewSike503 ..."
dh/sidh/sike.go:31:1: comment on exported function NewSike751 should be of the form "NewSike751 ..."
dh/sidh/sike.go:38:1: comment on exported method KEM.Allocate should be of the form "Allocate ..."
dh/sidh/sike.go:58:1: comment on exported method KEM.Encapsulate should be of the form "Encapsulate ..."
dh/sidh/sike.go:146:2: don't use underscores in Go names; var c1_len should be c1Len
dh/sidh/sike.go:178:1: comment on exported method KEM.Reset should be of the form "Reset ..."
dh/sidh/sike.go:191:1: comment on exported method KEM.CiphertextSize should be of the form "CiphertextSize ..."
dh/sidh/sike.go:196:1: comment on exported method KEM.SharedSecretSize should be of the form "SharedSecretSize ..."
dh/sidh/sike.go:244:6: don't use underscores in Go names; var c1_len should be c1Len
dh/sidh/sike.go:246:6: don't use underscores in Go names; var pk_len should be pkLen
dh/sidh/sike_test.go:54:2: don't use underscores in Go names; var pk_hex should be pkHex
dh/sidh/sike_test.go:56:2: don't use underscores in Go names; var sk_hex should be skHex
dh/sidh/sike_test.go:64:2: don't use underscores in Go names; var pt_len should be ptLen
dh/sidh/sike_test.go:93:2: don't use underscores in Go names; var pt_len should be ptLen
dh/sidh/sike_test.go:126:6: don't use underscores in Go names; var ss_e should be ssE
dh/sidh/sike_test.go:127:6: don't use underscores in Go names; var ss_d should be ssD
dh/sidh/sike_test.go:151:6: don't use underscores in Go names; var ss_e should be ssE
dh/sidh/sike_test.go:152:6: don't use underscores in Go names; var ss_d should be ssD
dh/sidh/sike_test.go:174:6: don't use underscores in Go names; var ss_e should be ssE
dh/sidh/sike_test.go:175:6: don't use underscores in Go names; var ss_d should be ssD
dh/sidh/sike_test.go:176:6: don't use underscores in Go names; var ss_tmp should be ssTmp
dh/sidh/sike_test.go:235:6: don't use underscores in Go names; var ss_e should be ssE
dh/sidh/sike_test.go:236:6: don't use underscores in Go names; var ss_d1 should be ssD1
dh/sidh/sike_test.go:237:6: don't use underscores in Go names; var ss_d2 should be ssD2
dh/sidh/internal/common/params.go:17:1: comment on exported function Register should be of the form "Register ..."
dh/sidh/internal/common/types.go:4:2: comment on exported const FP_MAX_WORDS should be of the form "FP_MAX_WORDS ..."
dh/sidh/internal/common/types.go:5:2: don't use ALL_CAPS in Go names; use CamelCase
dh/sidh/internal/common/types.go:6:2: comment on exported const MAX_SIDH_PRIVATE_KEY_BSZ should be of the form "MAX_SIDH_PRIVATE_KEY_BSZ ..."
dh/sidh/internal/common/types.go:7:2: don't use ALL_CAPS in Go names; use CamelCase
dh/sidh/internal/common/types.go:8:2: comment on exported const MAX_SIKE_PRIVATE_KEY_BSZ should be of the form "MAX_SIKE_PRIVATE_KEY_BSZ ..."
dh/sidh/internal/common/types.go:9:2: don't use ALL_CAPS in Go names; use CamelCase
dh/sidh/internal/common/types.go:10:2: comment on exported const MAX_MSG_BSZ should be of the form "MAX_MSG_BSZ ..."
dh/sidh/internal/common/types.go:11:2: don't use ALL_CAPS in Go names; use CamelCase
dh/sidh/internal/common/types.go:12:2: comment on exported const MAX_SHARED_SECRET_BSZ should be of the form "MAX_SHARED_SECRET_BSZ ..."
dh/sidh/internal/common/types.go:13:2: don't use ALL_CAPS in Go names; use CamelCase
dh/sidh/internal/common/types.go:14:2: comment on exported const MAX_PUBLIC_KEY_SZ should be of the form "MAX_PUBLIC_KEY_SZ ..."
dh/sidh/internal/common/types.go:15:2: don't use ALL_CAPS in Go names; use CamelCase
dh/sidh/internal/common/types.go:16:2: comment on exported const MAX_CIPHERTEXT_BSZ should be of the form "MAX_CIPHERTEXT_BSZ ..."
dh/sidh/internal/common/types.go:17:2: don't use ALL_CAPS in Go names; use CamelCase
dh/sidh/internal/common/types.go:23:2: don't use ALL_CAPS in Go names; use CamelCase
dh/sidh/internal/common/types.go:24:2: don't use ALL_CAPS in Go names; use CamelCase
dh/sidh/internal/common/types.go:27:1: comment on exported type Fp should be of the form "Fp ..." (with optional leading article)
dh/sidh/internal/common/types.go:34:1: comment on exported type FpX2 should be of the form "FpX2 ..." (with optional leading article)
dh/sidh/internal/common/types.go:37:1: comment on exported type Fp2 should be of the form "Fp2 ..." (with optional leading article)
dh/sidh/internal/common/types.go:43:6: exported type DomainParams should have comment or be unexported
dh/sidh/internal/common/types.go:45:2: don't use underscores in Go names; struct field Affine_P should be AffineP
dh/sidh/internal/common/types.go:45:12: don't use underscores in Go names; struct field Affine_Q should be AffineQ
dh/sidh/internal/common/types.go:45:22: don't use underscores in Go names; struct field Affine_R should be AffineR
dh/sidh/internal/common/types.go:54:6: exported type SidhParams should have comment or be unexported
dh/sidh/internal/common/types.go:55:2: struct field Id should be ID
dh/sidh/internal/common/types.go:77:1: comment on exported type CurveCoefficientsEquiv should be of the form "CurveCoefficientsEquiv ..." (with optional leading article)
dh/sidh/internal/common/types.go:88:1: comment on exported type ProjectivePoint should be of the form "ProjectivePoint ..." (with optional leading article)
dh/sidh/internal/common/types.go:97:1: comment on exported type ProjectiveCurveParameters should be of the form "ProjectiveCurveParameters ..." (with optional leading article)
dh/sidh/internal/common/utils.go:3:1: comment on exported function Cpick should be of the form "Cpick ..."
dh/sidh/internal/common/utils.go:14:1: comment on exported function BytesToFp2 should be of the form "BytesToFp2 ..."
dh/sidh/internal/common/utils.go:30:1: comment on exported function Fp2ToBytes should be of the form "Fp2ToBytes ..."
dh/sidh/internal/p503/params.go:11:2: comment on exported const FP_WORDS should be of the form "FP_WORDS ..."
dh/sidh/internal/p503/params.go:12:2: don't use ALL_CAPS in Go names; use CamelCase
dh/sidh/internal/p503/params.go:28:1: comment on exported var P503 should be of the form "P503 ..."
dh/sidh/internal/p503/params.go:34:1: comment on exported var P503x2 should be of the form "P503x2 ..."
dh/sidh/internal/p503/params.go:40:1: comment on exported var P503p1 should be of the form "P503p1 ..."
dh/sidh/internal/p503/params.go:46:1: comment on exported var P503R2 should be of the form "P503R2 ..."
dh/sidh/internal/p503/params.go:52:1: comment on exported var P503p1s8 should be of the form "P503p1s8 ..."
dh/sidh/internal/p503/params.go:58:1: comment on exported var P503p1Zeros should be of the form "P503p1Zeros ..."
dh/sidh/internal/p503/params_test.go:19:2: don't use underscores in Go names; var curve_A should be curveA
dh/sidh/internal/p503/params_test.go:24:2: don't use underscores in Go names; var curve_C should be curveC
dh/sidh/internal/p503/params_test.go:28:2: don't use underscores in Go names; var affine_xP should be affineXP
dh/sidh/internal/p503/params_test.go:32:2: don't use underscores in Go names; var affine_xP2 should be affineXP2
dh/sidh/internal/p503/params_test.go:36:2: don't use underscores in Go names; var affine_xP4 should be affineXP4
dh/sidh/internal/p503/params_test.go:40:2: don't use underscores in Go names; var affine_xP9 should be affineXP9
dh/sidh/internal/p751/params.go:11:2: comment on exported const FP_WORDS should be of the form "FP_WORDS ..."
dh/sidh/internal/p751/params.go:12:2: don't use ALL_CAPS in Go names; use CamelCase
dh/sidh/internal/p751/params.go:26:1: comment on exported var P751p1Zeros should be of the form "P751p1Zeros ..."
dh/sidh/internal/p751/params.go:29:1: comment on exported var P751 should be of the form "P751 ..."
dh/sidh/internal/p751/params.go:36:1: comment on exported var P751x2 should be of the form "P751x2 ..."
dh/sidh/internal/p751/params.go:43:1: comment on exported var P751p1 should be of the form "P751p1 ..."
dh/sidh/internal/p751/params.go:50:1: comment on exported var P751R2 should be of the form "P751R2 ..."
dh/sidh/internal/p751/params_test.go:16:2: don't use underscores in Go names; var curve_A should be curveA
dh/sidh/internal/p751/params_test.go:21:2: don't use underscores in Go names; var curve_C should be curveC
dh/sidh/internal/p751/params_test.go:26:2: don't use underscores in Go names; var affine_xP should be affineXP
dh/sidh/internal/p751/params_test.go:31:2: don't use underscores in Go names; var affine_xP2 should be affineXP2
dh/sidh/internal/p751/params_test.go:36:2: don't use underscores in Go names; var affine_xP4 should be affineXP4
dh/sidh/internal/p751/params_test.go:41:2: don't use underscores in Go names; var affine_xP9 should be affineXP9
ecc/fourQ/constants.go:3:1: don't use MixedCaps in package name; fourQ should be fourq
ecc/fourQ/curve.go:3:1: don't use MixedCaps in package name; fourQ should be fourq
ecc/fourQ/doc.go:1:1: package comment should be of the form "Package fourQ ..."
ecc/fourQ/doc.go:13:1: don't use MixedCaps in package name; fourQ should be fourq
ecc/fourQ/fp.go:3:1: don't use MixedCaps in package name; fourQ should be fourq
ecc/fourQ/fp_amd64.go:3:1: don't use MixedCaps in package name; fourQ should be fourq
ecc/fourQ/fp_amd64_test.go:3:1: don't use MixedCaps in package name; fourQ should be fourq
ecc/fourQ/fq.go:3:1: don't use MixedCaps in package name; fourQ should be fourq
ecc/fourQ/fq_amd64.go:3:1: don't use MixedCaps in package name; fourQ should be fourq
ecc/fourQ/fq_test.go:3:1: don't use MixedCaps in package name; fourQ should be fourq
ecc/fourQ/point.go:3:1: don't use MixedCaps in package name; fourQ should be fourq
ecc/fourQ/point.go:240:1: exported method Point.Marshal should have comment or be unexported
ecc/fourQ/point.go:248:1: exported method Point.Unmarshal should have comment or be unexported
ecc/fourQ/point_amd64.go:3:1: don't use MixedCaps in package name; fourQ should be fourq
ecc/fourQ/point_amd64.go:8:2: don't use underscores in Go names; const _x_ should be _x
ecc/fourQ/point_amd64.go:9:2: don't use underscores in Go names; const _y_ should be _y
ecc/fourQ/point_amd64.go:10:2: don't use underscores in Go names; const _z_ should be _z
ecc/fourQ/point_amd64.go:11:2: don't use underscores in Go names; const _ta_ should be _ta
ecc/fourQ/point_amd64.go:12:2: don't use underscores in Go names; const _tb_ should be _tb
ecc/fourQ/point_amd64.go:13:2: don't use underscores in Go names; const _addYX_R2_ should be _addYXR2
ecc/fourQ/point_amd64.go:14:2: don't use underscores in Go names; const _subYX_R2_ should be _subYXR2
ecc/fourQ/point_amd64.go:15:2: don't use underscores in Go names; const _z2_R2_ should be _z2R2
ecc/fourQ/point_amd64.go:16:2: don't use underscores in Go names; const _dt2_R2_ should be _dt2R2
ecc/fourQ/point_amd64.go:17:2: don't use underscores in Go names; const _addYX_R3_ should be _addYXR3
ecc/fourQ/point_amd64.go:18:2: don't use underscores in Go names; const _subYX_R3_ should be _subYXR3
ecc/fourQ/point_amd64.go:19:2: don't use underscores in Go names; const _dt2_R3_ should be _dt2R3
ecc/fourQ/point_test.go:3:1: don't use MixedCaps in package name; fourQ should be fourq
ecc/fourQ/tableBase.go:3:1: don't use MixedCaps in package name; fourQ should be fourq
ecc/fourQ/tableBase.go:7:2: don't use underscores in Go names; const fx_t should be fxT
ecc/fourQ/tableBase.go:9:2: don't use underscores in Go names; const fx_v should be fxV
ecc/fourQ/tableBase.go:11:2: don't use underscores in Go names; const fx_w should be fxW
ecc/fourQ/tableBase.go:13:2: don't use underscores in Go names; const fx_2w1 should be fx2w1
ecdh/ecdh_test.go:16:2: struct field TcId should be TcID
ecdh/ecdh_test.go:186:4: struct field TcId should be TcID
hash/sha3/sha3.go:197:1: comment on exported function NewLegacyKeccak256 should be of the form "NewLegacyKeccak256 ..."
hash/sha3/shake.go:22:1: comment on exported type CShake should be of the form "CShake ..." (with optional leading article)
internal/test/test.go:35:1: comment on exported function CheckNoErr should be of the form "CheckNoErr ..."
internal/test/test.go:38:1: comment on exported function CheckIsErr should be of the form "CheckIsErr ..."
internal/test/test.go:41:1: comment on exported function CheckPanic should be of the form "CheckPanic ..."
The text was updated successfully, but these errors were encountered:
golint
flags quite a lot of issues, so I thought I'd summarize them here. Notegolint
checks for the recommendations in the CodeReviewComments wiki page, which have become pretty standard in Go projects. I personally think these are worth fixing, but I wanted to put it up for discussion.don't use MixedCaps in package name
: This applies tocurve4Q
andfourQ
.don't use underscores in Go names
: There are lots of examples of this.comment on exported function NewSike503 should be of the form "NewSike503 ..."
: Go comment style recommends that comments for methods/functions/types are full sentences starting with the name of the thing being documented. Again there are quite a lot of examples of this.All golint issues
The text was updated successfully, but these errors were encountered: