19 lines
194 B
Go
19 lines
194 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
)
|
||
|
|
||
|
type Nums struct {
|
||
|
X float64
|
||
|
}
|
||
|
|
||
|
func (n Nums) Multiply() float64 {
|
||
|
return n.X * 2
|
||
|
}
|
||
|
|
||
|
func main() {
|
||
|
newnumber := Nums{10}
|
||
|
fmt.Println(newnumber.Multiply())
|
||
|
}
|