Skip to content

Commit c743fd1

Browse files
committed
updates
1 parent 437be2e commit c743fd1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

content/posts/go-notes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,12 @@ func main(){
627627

628628
But what happens if we declared `p` as `var p Person` instead? In that case default value of `p` will be the zero value of the fields inside the `Person` struct.
629629

630+
### Using functions vs. methods
631+
632+
> - Anytime your business logic depends on values that are configured at startup or changed while your program is running, those values should be stored in a struct, and that logic should be implemented as a method.
633+
634+
> - If your logic depends only on the input parameters, it should be a function
635+
630636
## Interfaces
631637

632638
- An interface is like an abstract class in Python.

themes/blowfish

Submodule blowfish updated 605 files

0 commit comments

Comments
 (0)