in cmd/cloudshell_open/main.go [617:651]
func promptInstrumentless() error {
coupon, err := instrumentlessCoupon()
if err != nil || coupon == nil {
fmt.Println(infoPrefix + " Create a new billing account:")
fmt.Println(" " + linkLabel.Sprint(billingCreateURL))
fmt.Println(questionPrefix + " " + "Once you're done, press " + parameterLabel.Sprint("Enter") + " to continue: ")
if _, err := bufio.NewReader(os.Stdin).ReadBytes('\n'); err != nil {
return err
}
return nil
}
code := ""
parts := strings.Split(coupon.URL, "code=")
if len(parts) == 2 {
code = parts[1]
} else {
return fmt.Errorf("could not get a coupon code")
}
fmt.Println(infoPrefix + " Open this page:\n " + linkLabel.Sprint(trygcpURL))
fmt.Println(infoPrefix + " Use this coupon code:\n " + code)
fmt.Println(questionPrefix + " Once you're done, press " + parameterLabel.Sprint("Enter") + " to continue: ")
if _, err := bufio.NewReader(os.Stdin).ReadBytes('\n'); err != nil {
return err
}
return nil
}