func (s *Story) GodocURL() string {
	if s.Code() {
		return strings.Replace(s.URL, "https://github.com", "https://godoc.org/github.com", 1)
	}
	return ""
}
GodocURL returns the godoc.org URL for this story, or empty string if none
package stories
import (
	"fmt"
	"strings"
	"time"
	"github.com/fragmenta/model/file"
	"github.com/kennygrant/gohackernews/src/lib/resource"
	"github.com/kennygrant/gohackernews/src/lib/status"
)
type Story struct {
	resource.Base
	status.ResourceStatus
	Name         string
	Summary      string
	URL          string
	UserID       int64
	Points       int64
	Rank         int64
	CommentCount int64
	UserName string
}
func (s *Story) Domain() string {
	parts := strings.Split(s.URL, "/")
	if len(parts) > 2 {
		return strings.Replace(parts[2], "www.", "", 1)
	}
	if len(s.URL) > 0 {
		return s.URL
	}
	return "GN"
}
func (s *Story) ShowAsk() bool {
	return strings.HasPrefix(s.Name, "Show:") || strings.HasPrefix(s.Name, "Ask:")
}
func (s *Story) DestinationURL() string {
	if s.Points < 0 {
		return ""
	}
	if s.URL != "" {
		return s.URL
	}
	return s.CanonicalURL()
}
func (s *Story) PrimaryURL() string {
	if s.YouTube() || s.ShowAsk() || s.URL == "" {
		return s.CanonicalURL()
	}
	return s.DestinationURL()
}
func (s *Story) CanonicalURL() string {
	return fmt.Sprintf("/stories/%d-%s", s.ID, file.SanitizeName(s.Name))
}
func (s *Story) Code() bool {
	if strings.Contains(s.URL, "https://github.com") {
		if strings.Contains(s.URL, "/commit/") || strings.Contains(s.URL, "/releases/") || strings.HasSuffix(s.URL, ".md") {
			return false
		}
		return true
	}
	return false
}