writeToDisk takes a string containing a Spotify URI and writes to the the filepath specified in the diskplayer.yaml configuration file under the recorder.file_path field. Returns an error if one is encountered.
(spotifyUri, fullPath string)
| 46 | // configuration file under the recorder.file_path field. |
| 47 | // Returns an error if one is encountered. |
| 48 | func writeToDisk(spotifyUri, fullPath string) error { |
| 49 | |
| 50 | b := []byte(spotifyUri) |
| 51 | err := ioutil.WriteFile(fullPath, b, 0644) |
| 52 | if err != nil { |
| 53 | return err |
| 54 | } |
| 55 | |
| 56 | |
| 57 | return nil |
| 58 | } |