You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: markdown.go
    path of file: ./repos/mattermost/server/public/shared/markdown
    
    the code of the file until where you have to start completion: // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

// This package implements a parser for the subset of the CommonMark spec necessary for us to do
// server-side processing. It is not a full implementation and lacks many features. But 
    
func trimBytesFromRanges(ranges []Range, bytes int) (result []Range) {
	rem := bytes
	for _, r := range ranges {
		if rem == 0 {
			result = append(result, r)
			continue
		}
		l := r.End - r.Position
		if rem < l {
			result = append(result, Range{r.Position + rem, r.End})
			rem = 0
			continue
		}
		rem -= l
	}
	return
}