Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit bccfbff

Browse files
author
mostafa
committed
internal represent interface
1 parent 1b7d9bf commit bccfbff

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎advanced/interface/basic.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,17 @@ func main() {
3737
}
3838

3939
TotalExpense(empPermanent)
40+
// internal representation
41+
var w SalaryCalculator = empPermanent
42+
TotalExpense(w)
4043

4144
empContarctual := Contractual{
4245
JobType: "contract",
4346
Salary: 5000,
4447
}
4548

4649
TotalExpense(empContarctual)
50+
// internal representation
51+
var y SalaryCalculator = empContarctual
52+
TotalExpense(y)
4753
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /