How to write fraction in Go?

Good time.
Must be stored in variables, record the fractions, for example 1/4 and not 0.25.
I.e. something like :
//Of course it doesn't work!!! Code inserted for example

var ch1 float64
ch1 = 1 / 4
fmt.Println(ch1)

//--------------
0.25


Maybe someone faced with such a task.
Thank you in advance.
July 2nd 19 at 13:11
2 answers
July 2nd 19 at 13:13
Solution
var ch1 float64
ch1 = float64(1) / 4
fmt.Println(ch1)

https://play.golang.org/p/Zr6WVBs1dt
July 2nd 19 at 13:15
Make the structure, pass it text, then make this package and add methods for managing, converting and so on...

package main

import (
"fmt"
"strings"
"errors"
)

func main() {
 fmt.Println("Hello, playground")

 d := New()
d.Parse("1/4")
fmt.Println(d)
}

Shot type struct {
 i string // number
 f string // fraction
}

func New() (s *Shot) {
 s = new(Shot)
return
}

func (s *Shot) Parse(text string) (err error) {
 v := strings.Split(text, "/")
 if len(v) != 2 {
 err = errors.New("parse Error shot")
 return 
}
 s.i = v[0]
 s.f = v[1]
return
}

Find more questions by tags Go