Skip to content

Remove unused code #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ go 1.14
require (
github.com/arduino/go-paths-helper v1.5.0
github.com/arduino/golang-concurrent-workers v0.0.0-20170202182617-6710cdc954bc
github.com/blang/semver v3.5.1+incompatible
github.com/go-git/go-git/v5 v5.3.0
github.com/google/go-github v17.0.0+incompatible
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/go-cmp v0.5.2 // indirect
github.com/stretchr/testify v1.7.0
github.com/vaughan0/go-ini v0.0.0-20130923145212-a98ad7ee00ec
)
6 changes: 0 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ github.com/arduino/golang-concurrent-workers v0.0.0-20170202182617-6710cdc954bc
github.com/arduino/golang-concurrent-workers v0.0.0-20170202182617-6710cdc954bc/go.mod h1:E+WBbLkFBdPp+N+yijgbdDI33mr5pm6j42RYLN5K4do=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
Expand All @@ -36,10 +34,6 @@ github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY=
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
Expand Down
70 changes: 0 additions & 70 deletions libraries/bad_file_cleaner.go

This file was deleted.

45 changes: 0 additions & 45 deletions libraries/bad_file_cleaner_test.go

This file was deleted.

76 changes: 0 additions & 76 deletions libraries/cron/fill_missing_checksums.go

This file was deleted.

78 changes: 0 additions & 78 deletions libraries/github_release_downloader.go

This file was deleted.

40 changes: 0 additions & 40 deletions libraries/github_release_downloader_test.go

This file was deleted.

32 changes: 0 additions & 32 deletions libraries/metadata/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ package metadata

import (
"bytes"
"context"
"encoding/base64"
"errors"

"github.com/google/go-github/github"
ini "github.com/vaughan0/go-ini"
)

Expand All @@ -62,34 +58,6 @@ type LibraryMetadata struct {
Depends string
}

// ParsePullRequest makes a LibraryMetadata by reading library.properties from a github.PullRequest
func ParsePullRequest(gh *github.Client, pull *github.PullRequest) (*LibraryMetadata, error) {
head := *pull.Head
headRepo := *head.Repo

// Get library.properties from pull request HEAD
getContentOpts := &github.RepositoryContentGetOptions{
Ref: *head.SHA,
}
libPropContent, _, _, err := gh.Repositories.GetContents(context.TODO(), *headRepo.Owner.Login, *headRepo.Name, "library.properties", getContentOpts)
if err != nil {
return nil, err
}
if libPropContent == nil {
return nil, errors.New("library.properties file not found")
}
return ParseRepositoryContent(libPropContent)
}

// ParseRepositoryContent makes a LibraryMetadata by reading library.properties from a github.RepositoryContent
func ParseRepositoryContent(content *github.RepositoryContent) (*LibraryMetadata, error) {
libPropertiesData, err := base64.StdEncoding.DecodeString(*content.Content)
if err != nil {
return nil, err
}
return Parse(libPropertiesData)
}

// Parse makes a LibraryMetadata by parsing a library.properties file contained in a byte array
func Parse(propertiesData []byte) (*LibraryMetadata, error) {
// Create an io.Reader from []bytes
Expand Down
Loading