Skip to content

Commit

Permalink
Some fixes in example after golang liters
Browse files Browse the repository at this point in the history
  • Loading branch information
k8s4 committed Dec 1, 2024
1 parent f744509 commit 7cdc946
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
17 changes: 9 additions & 8 deletions examples/golang/cource/06i_code_quality/.golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ output:
linters:
enable-all: true
disable:
- stylecheck
- revive
- wsl
- gofmt
- gosimple
- gofumpt
- goimports
- nlreturn
# - stylecheck
# - revive
# - wsl
# - gofmt
# - gosimple
# - gofumpt
# - goimports
# - nlreturn
- exportloopref
- mnd
fast: false

issues:
Expand Down
35 changes: 17 additions & 18 deletions examples/golang/cource/06i_code_quality/someexample.go
Original file line number Diff line number Diff line change
@@ -1,53 +1,52 @@
// Package someexample -.
package someexample

// Person -.
type Person struct {
Name string
Age int
Age int
}

// GetName blah
// GetName blah.
func (p Person) GetName() string {
return p.Name
}

// Avatar struct -.
type Avatar struct {
URL string
URL string
Size int64
}

// Client -.
type Client struct {
ID int64
Img Avatar
ID int64
Img Avatar
Name string
Age int64
Age int64
}

// HasAvatar ===
func (c Client) HasAvatar() bool {
if c.Img.URL != "" {
return true
}
return false
// HasAvatar -.
func (c *Client) HasAvatar() bool {
return c.Img.URL != ""
}

// UpdateAvatar ...
// UpdateAvatar -.
func (c *Client) UpdateAvatar() {
c.Img.URL = "new_url"
}

// GetName -.
func (c Client) GetName() string {
func (c *Client) GetName() string {
return c.Name
}

//NewClient -.
// NewClient -.
func NewClient(name string, age int, img Avatar) *Client {
return &Client{
ID: 7,
ID: 7,
Name: name,
Age: int64(age),
Img: img,
Age: int64(age),
Img: img,
}
}

0 comments on commit 7cdc946

Please sign in to comment.