Documentation
¶
Overview ¶
Copyright © 2022 david amick git@davidamick.com
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2022 david amick git@davidamick.com
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PreserveComments ¶
PreserveComments attempts to preserve the spacing before all comments walk matching nodes, and for each that has (Head|Line|Foot)Comment != "",
overwrite the newContent spacing and comment with the oldContent spacing and comment.
func PreserveEmptyLines ¶
PreserveEmptyLines attempts to re-add to newContent any empty lines
that were there in oldContent.
current algorithm simply associates each empty line with the yaml node on the line below it if there is one. it then re-adds them to newContent above the matching yaml node. it also re-adds empty line(s) at the end of the file if there were any. this may not always have the desired effect, but should in many cases.
Types ¶
This section is empty.