Cost of goods sold is the expense recorded on the income statement once inventory is sold to a third party

Explanation of Cost of Goods Sold in Go Language

// Step 1: Determine the beginning inventory at the start of the accounting period.
beginningInventory := 10000.00

// Step 2: Add the cost of additional inventory purchased during the accounting period.
purchasedInventory := 5000.00

// Step 3: Subtract the ending inventory at the end of the accounting period.
endingInventory := 7000.00

// Step 4: Calculate the Cost of Goods Sold (COGS) using the formula:
costOfGoodsSold := beginningInventory + purchasedInventory - endingInventory