28 lines
400 B
Go
28 lines
400 B
Go
package main
|
|
|
|
import "fmt"
|
|
|
|
|
|
type Employee struct {
|
|
name string
|
|
position string
|
|
salary int
|
|
currency string
|
|
}
|
|
|
|
func (e Employee) DisplayInfo() {
|
|
fmt.Println("Name: ", e.name)
|
|
fmt.Println("Position: ",e.position)
|
|
fmt.Printf("Salary: %d %s\n",e.salary,e.currency)
|
|
}
|
|
|
|
func main(){
|
|
emp := Employee {
|
|
name: "Bob",
|
|
position: "senior",
|
|
salary: 10000,
|
|
currency: "RUB",
|
|
}
|
|
emp.DisplayInfo()
|
|
}
|