Skip to content

Commit

Permalink
Doc: remove unnecessary code comments (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhd999 authored Feb 28, 2020
1 parent 7c2da00 commit 6eb09df
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 13 deletions.
1 change: 0 additions & 1 deletion cmd/check/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ type (
version struct {
Ref string `json:"ref"`
}
// InputJSON ...
InputJSON struct {
Params map[string]string `json:"params"`
Source map[string]string `json:"source"`
Expand Down
1 change: 0 additions & 1 deletion cmd/in/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ type (
version struct {
Ref string `json:"ref"`
}
// InputJSON ...
InputJSON struct {
Params map[string]string `json:"params"`
Source map[string]string `json:"source"`
Expand Down
2 changes: 0 additions & 2 deletions cmd/out/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ import (
"github.com/telia-oss/appsync-resource/out"
)

// createOutput ...
func createOutput(output interface{}, encoder *json.Encoder, logger *log.Logger) error {
_, err := json.MarshalIndent(output, "", " ")
if err != nil {
return err
}
// encode output to stdout
return encoder.Encode(output)

}
Expand Down
9 changes: 0 additions & 9 deletions out/out.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ var env = os.Getenv("ENV")

// Command will update the resource.
func Command(input InputJSON, logger *log.Logger) (outOutputJSON, error) {

// PARSE THE JSON FILE input.json
apiID, ok := input.Source["api_id"]
if !ok {
return outOutputJSON{}, errors.New("api_id not set")
Expand Down Expand Up @@ -50,7 +48,6 @@ func Command(input InputJSON, logger *log.Logger) (outOutputJSON, error) {
var resolverOutput []metadata
var schemaOutput []metadata

// AWS creds
awsConfig := resource.NewAwsConfig(
accessKey,
secretKey,
Expand All @@ -64,7 +61,6 @@ func Command(input InputJSON, logger *log.Logger) (outOutputJSON, error) {
return outOutputJSON{}, errors.New("resolversFile and schemaFile both are not set")
}

// Create or update schema
if schemaFile != "" {
var schemaFilePath string
if env == "development" {
Expand All @@ -75,13 +71,11 @@ func Command(input InputJSON, logger *log.Logger) (outOutputJSON, error) {
}
schema, _ := ioutil.ReadFile(schemaFilePath)

// Start create or update schema
error := client.StartSchemaCreationOrUpdate(apiID, schema)
if error != nil {
logger.Fatalf("failed to create/update the schema: %s", error)
}

// get schema creation status
creationStatus, creationDetails, err := client.GetSchemaCreationStatus(apiID)
if err != nil {
logger.Println("Failed to get Schema Creation status, However the Schema creation might be succeeded, check the AWS console and re-tigger the build if the schema not created/updated: %s", err)
Expand All @@ -90,14 +84,12 @@ func Command(input InputJSON, logger *log.Logger) (outOutputJSON, error) {
{Name: "creationDetails", Value: "unknown"},
}
} else {
// OUTPUT
schemaOutput = []metadata{
{Name: "creationStatus", Value: creationStatus},
{Name: "creationDetails", Value: creationDetails},
}
}
}
// update Resolvers
if resolversFile != "" {
var resolversFilePath string
if env == "development" {
Expand All @@ -112,7 +104,6 @@ func Command(input InputJSON, logger *log.Logger) (outOutputJSON, error) {
if err != nil {
logger.Println("failed to create/update", err)
}
// OUTPUT
resolverOutput = []metadata{
{Name: "number of resolvers successfully created", Value: nResolversSuccessfullyCreated},
{Name: "number of resolver successfully updated", Value: nResolversSuccessfullyUpdated},
Expand Down

0 comments on commit 6eb09df

Please sign in to comment.