Skip to content

Instantly share code, notes, and snippets.

@GerardoHP
Created March 28, 2023 19:47
Show Gist options
  • Save GerardoHP/be1e490a7f23d0bf92b302ad97c8748d to your computer and use it in GitHub Desktop.
Save GerardoHP/be1e490a7f23d0bf92b302ad97c8748d to your computer and use it in GitHub Desktop.

Revisions

  1. GerardoHP created this gist Mar 28, 2023.
    16 changes: 16 additions & 0 deletions mkExercise
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    #!/bin/sh

    # Find the module file of go
    if find go.mod
    then
    # Change to the structure
    if cd $1
    then
    echo "package $1" >> "$2.go"
    echo "package $1_test" >> "$2_test.go"
    else
    echo "the folder $1 does not existe"
    fi
    else
    echo "the current location does not meet the criteria for a go root folder"
    fi