discountRate added to struct

This commit is contained in:
Mert Gör 🇹🇷 2024-01-20 14:48:38 +03:00
parent 7f5e074730
commit 9c1a8d8e99
Signed by: hwpplayer1
GPG Key ID: 03E547D043AB6C8F

View File

@ -3,11 +3,12 @@ package structs
import "fmt" import "fmt"
func Demo1() { func Demo1() {
fmt.Println(product{"Computer", 5000, "XYZ"}) fmt.Println(product{"Computer", 5000, "XYZ", 20})
} }
type product struct { type product struct {
name string name string
unitPrice float64 unitPrice float64
brand string brand string
discountRate int
} }