Fix lint issues: shadow declaration, goimports, and code duplication #2144
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | name: Test DevContainer Image | ||
| on: | ||
| push: | ||
| - 'testdata/**' | ||
| - '.github/workflows/test-devcontainer.yml' | ||
| pull_request: | ||
| paths: | ||
| - 'testdata/**' | ||
| - '.github/workflows/test-devcontainer.yml' | ||
| jobs: | ||
| test-devcontainer: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v5 | ||
| - name: Setup Go | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: go.mod | ||
| - name: Setup NodeJS 20.x | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: "20.x" | ||
| - name: Setup Devcontainer CLI | ||
| run: | | ||
| npm install -g @devcontainers/cli | ||
| - name: Build and Validate DevContainer | ||
| run: | | ||
| cd testdata/project-v4 | ||
| OUTPUT=$(devcontainer up --workspace-folder=./) | ||
| STATUS=$(echo "$OUTPUT" | jq -r '.outcome') | ||
| if [[ "$STATUS" == "success" ]]; then | ||
| echo "Devcontainer setup was successful." | ||
| exit 0 | ||
| else | ||
| echo "Devcontainer setup failed." | ||
| exit 1 | ||
| fi | ||