Golang interactive SSH for Cisco ASA

I need to retrieve the configuration of a Cisco ASA with Golang and SSH. This is what I achieved.

// GetConfiguration to the firewall
func (f *ciscoASA) GetConfiguration() error {
    // Create a session
    session, err := f.client.NewSession()
    if err != nil {
        return fmt.Errorf("Failed to create session: %s", err)
    }
    defer session.Close()

    stdin, err := session.StdinPipe()
    if err != nil {
        return fmt.Errorf("Failed to create stdin pipe: %s", err)
    }
    //session.Stdout = os.Stdout
    //session.Stderr = os.Stderr

    // Start a shell
    err = session.Shell()
    if err != nil {
        return fmt.Errorf("Failed to start a shell: %s", err)
    }

    // Password
    _, err = stdin.Write([]byte(f.password))
    if err != nil {
        return fmt.Errorf("Failed to send password: %s", err)
    }

    // Enable
    _, err = stdin.Write([]byte("enable"))
    if err != nil {
        return fmt.Errorf("Failed to send enable: %s", err)
    }

    // Show running
    _, err = stdin.Write([]byte("sh run"))
    if err != nil {
        return fmt.Errorf("Failed to send sh run: %s", err)
    }

    // Show version
    _, err = stdin.Write([]byte("sh version"))
    if err != nil {
        return fmt.Errorf("Failed to send sh version: %s", err)
    }

    // Exit
    _, err = stdin.Write([]byte("exit"))
    if err != nil {
        return fmt.Errorf("Failed to send exit: %s", err)
    }

    return nil
}

I known that the key of solving this problem is to use StdoutPipe but I absolutely do not know how..

Do I need to create a loop at the end of each stdin command in order to wait for a result, or maybe there is a built-in function to do that ?

The first waiting is for the password prompt, then the enable and then I need to retrieve the configuration and the version.