Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.






                package main

import (


// Retrieve playlistItems in the specified playlist
func playlistItemsList(service *youtube.Service, part string, playlistId string, pageToken string) *youtube.PlaylistItemListResponse {
        call := service.PlaylistItems.List(part)
        call = call.PlaylistId(playlistId)
        if pageToken != "" {
                call = call.PageToken(pageToken)
        response, err := call.Do()
        handleError(err, "")
        return response

// Retrieve resource for the authenticated user's channel
func channelsListMine(service *youtube.Service, part string) *youtube.ChannelListResponse {
        call := service.Channels.List(part)
        call = call.Mine(true)
        response, err := call.Do()
        handleError(err, "")
        return response

func main() {
        client := getClient(youtube.YoutubeReadonlyScope)
        service, err := youtube.New(client)
        if err != nil {
                log.Fatalf("Error creating YouTube client: %v", err)

        response := channelsListMine(service, "contentDetails")

        for _, channel := range response.Items {
                playlistId := channel.ContentDetails.RelatedPlaylists.Uploads
                // Print the playlist ID for the list of uploaded videos.
                fmt.Printf("Videos in list %s\r\n", playlistId)

                nextPageToken := ""
                for {
                        // Retrieve next set of items in the playlist.
                        playlistResponse := playlistItemsList(service, "snippet", playlistId, nextPageToken)
                        for _, playlistItem := range playlistResponse.Items {
                                title := playlistItem.Snippet.Title
                                videoId := playlistItem.Snippet.ResourceId.VideoId
                                fmt.Printf("%v, (%v)\r\n", title, videoId)

                        // Set the token to retrieve the next page of results
                        // or exit the loop if all results have been retrieved.
                        nextPageToken = playlistResponse.NextPageToken
                        if nextPageToken == "" {