Skip to content

workshop: codereview#8

Open
zulfahmi14 wants to merge 1 commit intotherizk:masterfrom
zulfahmi14:workshop
Open

workshop: codereview#8
zulfahmi14 wants to merge 1 commit intotherizk:masterfrom
zulfahmi14:workshop

Conversation

@zulfahmi14
Copy link

No description provided.

"log"

"github.com/tokopedia/code-review-workshop/database"
redislib "github.com/tokopedia/code-review-workshop/redis"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

importnya bisa dirapihkan lagi, pisahkan external import dan internal import

var err error
db, err = database.Get(database.PromoCatalog)
if err != nil {
log.Printf("Cannot connect to DB. %+v", err)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cukup di log.Printf aja kah?

"context"

"github.com/tokopedia/code-review-workshop/errors"
mnilai "github.com/tokopedia/code-review-workshop/module/nilai"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

importnya bisa dirapihkan lagi, pisahkan external import dan internal import

return resp, errors.AddTrace(err)
}

detailSekolah, err := nilai.GetDetailSekolah(ctx, nilai.Sekolah[0])
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetDetailSekolah bisa diluar condition

}

resp = mappingGetNilaiSiswa(nilai, detailSekolah)
} else if sekolah == "semua" {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cukup "else" aja

"github.com/tokopedia/tokopoints/tracer"
)

func GetNilaiSiswa(ctx context.Context, nim int64, sekolah, kelas string, mapel_id int64) (resp GetNilaiSiswaResponse, err error) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

terlalu banyak param, lebih baik dibuat dalam 1 struct khusus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants